Skip to content
Merged
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
Copy link
Contributor

@anthonykim1 anthonykim1 Nov 13, 2025

Choose a reason for hiding this comment

The 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 terminal.integrated.shellIntegration.timeout and some improvements that came along the way. (default value -1 for the setting should be enough)

}

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