-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Avoid waiting for shell integration #1555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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; | ||
|
|
@@ -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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does removing this break anything? If it was to avoid potentially a dup looking command in the terminal, I think we should be in better position with new |
||
| } | ||
|
|
||
| if (shellIntegrationAvailable && terminal.shellIntegration) { | ||
| if (terminal.shellIntegration) { | ||
| terminal.shellIntegration.executeCommand(command); | ||
| } else { | ||
| terminal.sendText(command); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.