mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 01:58:53 +01:00
insert a 1 sec delay before using a newly created integr. terminal; a companion fix for #38578
This commit is contained in:
@@ -89,6 +89,7 @@ export class ExtHostDebugService extends ExtHostDebugServiceBase {
|
||||
const configProvider = await this._configurationService.getConfigProvider();
|
||||
const shell = this._terminalService.getDefaultShell(true, configProvider);
|
||||
let cwdForPrepareCommand: string | undefined;
|
||||
let giveShellTimeToInitialize = false;
|
||||
|
||||
if (needNewTerminal || !this._integratedTerminalInstance) {
|
||||
|
||||
@@ -98,7 +99,9 @@ export class ExtHostDebugService extends ExtHostDebugServiceBase {
|
||||
cwd: args.cwd,
|
||||
name: args.title || nls.localize('debug.terminal.title', "debuggee"),
|
||||
};
|
||||
giveShellTimeToInitialize = true;
|
||||
this._integratedTerminalInstance = this._terminalService.createTerminalFromOptions(options, true);
|
||||
|
||||
} else {
|
||||
cwdForPrepareCommand = args.cwd;
|
||||
}
|
||||
@@ -108,6 +111,12 @@ export class ExtHostDebugService extends ExtHostDebugServiceBase {
|
||||
terminal.show();
|
||||
|
||||
const shellProcessId = await this._integratedTerminalInstance.processId;
|
||||
|
||||
if (giveShellTimeToInitialize) {
|
||||
// give a new terminal some time to initialize the shell
|
||||
await new Promise(resolve => setTimeout(resolve, 1000));
|
||||
}
|
||||
|
||||
const command = prepareCommand(shell, args.args, cwdForPrepareCommand, args.env);
|
||||
terminal.sendText(command, true);
|
||||
|
||||
@@ -124,3 +133,4 @@ export class ExtHostDebugService extends ExtHostDebugServiceBase {
|
||||
return new ExtHostVariableResolverService(folders, editorService, configurationService, process.env as env.IProcessEnvironment);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user