MCPcopy Index your code
hub / github.com/microsoft/vscode-js-debug / VSCodeTerminalProcess

Class VSCodeTerminalProcess

src/targets/node/terminalNodeLauncher.ts:30–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28const SHELL_PROCESS_ID_TIMEOUT = 1000;
29
30class VSCodeTerminalProcess implements IProgram {
31 public readonly stopped: Promise<IStopMetadata>;
32
33 constructor(private readonly terminal: vscode.Terminal) {
34 this.stopped = new Promise(resolve => {
35 const disposable = vscode.window.onDidCloseTerminal(t => {
36 if (t === terminal) {
37 resolve({ code: 0, killed: true });
38 disposable.dispose();
39 }
40 });
41 });
42 }
43
44 public gotTelemetery() {
45 // no-op
46 }
47
48 public stop() {
49 // send ctrl+c to sigint any running processs (vscode/#108289)
50 this.terminal.sendText('\x03');
51 // and then destroy it on the next event loop tick
52 setTimeout(() => this.terminal.dispose(), 1);
53
54 return this.stopped;
55 }
56}
57
58export interface ITerminalLauncherLike extends NodeLauncherBase<ITerminalLaunchConfiguration> {
59 /**

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected