提交 bd980139 编写于 作者: A Andre Weinand

insert a 1 sec delay before using a newly created integr. terminal; a companion fix for #38578

上级 56947b3a
......@@ -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);
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册