Skip to content
This repository was archived by the owner on Jul 31, 2023. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/debugger/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';

import {workspace} from 'vscode';
import {DebugSession, InitializedEvent, TerminatedEvent, StoppedEvent, BreakpointEvent, OutputEvent, Thread, StackFrame, Scope, Source, Handles, Breakpoint} from 'vscode-debugadapter';
import {DebugProtocol} from 'vscode-debugprotocol';
import {readFileSync,existsSync} from 'fs';
Expand Down Expand Up @@ -452,9 +453,11 @@ class RubyDebugSession extends DebugSession {
}

protected disconnectRequest(response: DebugProtocol.DisconnectResponse, args: DebugProtocol.DisconnectArguments) {
const detachDebugger = workspace.getConfiguration('ruby').detachDebugger && this.debugMode === Mode.attach;
if (this.rubyProcess.state !== SocketClientState.closed) {
this.rubyProcess.Run('quit');
this.rubyProcess.Run(detachDebugger ? 'detach' : 'quit');
}

this.sendResponse(response);
}
}
Expand Down