mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 10:08:49 +01:00
new debug setting for clearing a terminal before reusing; fixes #116699
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
import * as nls from 'vs/nls';
|
||||
import type * as vscode from 'vscode';
|
||||
import * as platform from 'vs/base/common/platform';
|
||||
import { DebugAdapterExecutable } from 'vs/workbench/api/common/extHostTypes';
|
||||
import { ExecutableDebugAdapter, SocketDebugAdapter, NamedPipeDebugAdapter } from 'vs/workbench/contrib/debug/node/debugAdapter';
|
||||
import { AbstractDebugAdapter } from 'vs/workbench/contrib/debug/common/abstractDebugAdapter';
|
||||
@@ -109,10 +110,23 @@ export class ExtHostDebugService extends ExtHostDebugServiceBase {
|
||||
if (giveShellTimeToInitialize) {
|
||||
// give a new terminal some time to initialize the shell
|
||||
await new Promise(resolve => setTimeout(resolve, 1000));
|
||||
} else {
|
||||
if (configProvider.getConfiguration('debug.terminal').get<boolean>('clearBeforeReusing')) {
|
||||
// clear terminal before reusing it
|
||||
if (shell.indexOf('powershell') >= 0 || shell.indexOf('pwsh') >= 0 || shell.indexOf('cmd.exe') >= 0) {
|
||||
terminal.sendText('cls');
|
||||
} else if (shell.indexOf('bash') >= 0) {
|
||||
terminal.sendText('clear');
|
||||
} else if (platform.isWindows) {
|
||||
terminal.sendText('cls');
|
||||
} else {
|
||||
terminal.sendText('clear');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const command = prepareCommand(shell, args.args, cwdForPrepareCommand, args.env);
|
||||
terminal.sendText(command, true);
|
||||
terminal.sendText(command);
|
||||
|
||||
// Mark terminal as unused when its session ends, see #112055
|
||||
const sessionListener = this.onDidTerminateDebugSession(s => {
|
||||
|
||||
Reference in New Issue
Block a user