Skip to content
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ ELECTRON_RUN_AS_NODE=1 "${process.execPath}" "${path.join(storageLocation, COPIL
private async sendCommandToTerminal(terminal: Terminal, command: string, waitForPythonActivation: boolean) {
// Wait for shell integration to be available
const shellIntegrationTimeout = 3000;
let shellIntegrationAvailable = false;
const integrationPromise = new Promise<void>((resolve) => {
let shellIntegrationAvailable = terminal.shellIntegration ? true : false;
const integrationPromise = shellIntegrationAvailable ? Promise.resolve() : new Promise<void>((resolve) => {
const disposable = this._register(this.terminalService.onDidChangeTerminalShellIntegration(e => {
if (e.terminal === terminal && e.shellIntegration) {
shellIntegrationAvailable = true;
Expand All @@ -185,7 +185,7 @@ ELECTRON_RUN_AS_NODE=1 "${process.execPath}" "${path.join(storageLocation, COPIL
await new Promise<void>(resolve => this._register(disposableTimeout(resolve, 500))); // Wait a bit to ensure the terminal is ready
}

if (shellIntegrationAvailable && terminal.shellIntegration) {
if (terminal.shellIntegration) {
terminal.shellIntegration.executeCommand(command);
} else {
terminal.sendText(command);
Expand Down
Loading