Skip to content

Commit 0c3fb42

Browse files
committed
Disable seamless relaunch on Windows/remote/ConPTY
The fast process spawn, kill, spawn was causing problems on remotes Fixes microsoft#187084
1 parent 2210138 commit 0c3fb42

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

src/vs/platform/terminal/node/terminalProcess.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { IProcessEnvironment, isLinux, isMacintosh, isWindows } from 'vs/base/co
1313
import { URI } from 'vs/base/common/uri';
1414
import { Promises } from 'vs/base/node/pfs';
1515
import { localize } from 'vs/nls';
16-
import { ILogService, LogLevel } from 'vs/platform/log/common/log';
16+
import { ILogService } from 'vs/platform/log/common/log';
1717
import { IProductService } from 'vs/platform/product/common/productService';
1818
import { FlowControlConstants, IShellLaunchConfig, ITerminalChildProcess, ITerminalLaunchError, IProcessProperty, IProcessPropertyMap as IProcessPropertyMap, ProcessPropertyType, TerminalShellType, IProcessReadyEvent, ITerminalProcessOptions, PosixShellType, IProcessReadyWindowsPty } from 'vs/platform/terminal/common/terminal';
1919
import { ChildProcessMonitor } from 'vs/platform/terminal/node/childProcessMonitor';

src/vs/workbench/contrib/terminal/browser/terminalInstance.ts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2080,24 +2080,33 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
20802080
this._refreshEnvironmentVariableInfoWidgetState(info);
20812081
}
20822082

2083-
private _refreshEnvironmentVariableInfoWidgetState(info?: IEnvironmentVariableInfo): void {
2083+
private async _refreshEnvironmentVariableInfoWidgetState(info?: IEnvironmentVariableInfo): Promise<void> {
20842084
// Check if the status should exist
20852085
if (!info) {
20862086
this.statusList.remove(TerminalStatus.RelaunchNeeded);
20872087
this.statusList.remove(TerminalStatus.EnvironmentVariableInfoChangesActive);
20882088
return;
20892089
}
20902090

2091-
// Recreate the process if the terminal has not yet been interacted with and it's not a
2092-
// special terminal (eg. extension terminal)
2091+
// Recreate the process seamlessly without informing the use if the following conditions are
2092+
// met.
20932093
if (
2094+
// The change requires a relaunch
20942095
info.requiresAction &&
2096+
// The feature is enabled
20952097
this._configHelper.config.environmentChangesRelaunch &&
2098+
// Has not been interacted with
20962099
!this._processManager.hasWrittenData &&
2100+
// Not a feature terminal or is a reconnecting task terminal (TODO: Need to explain the latter case)
20972101
(!this._shellLaunchConfig.isFeatureTerminal || (this.reconnectionProperties && this._configurationService.getValue(TaskSettingId.Reconnection) === true)) &&
2098-
!this._shellLaunchConfig.customPtyImplementation
2099-
&& !this._shellLaunchConfig.isExtensionOwnedTerminal &&
2100-
!this._shellLaunchConfig.attachPersistentProcess
2102+
// Not a custom pty
2103+
!this._shellLaunchConfig.customPtyImplementation &&
2104+
// Not an extension owned terminal
2105+
!this._shellLaunchConfig.isExtensionOwnedTerminal &&
2106+
// Not a reconnected or revived terminal
2107+
!this._shellLaunchConfig.attachPersistentProcess &&
2108+
// Not a Windows remote using ConPTY (#187084)
2109+
!(this._processManager.remoteAuthority && this._configHelper.config.windowsEnableConpty && (await this._processManager.getBackendOS()) === OperatingSystem.Windows)
21012110
) {
21022111
this.relaunch();
21032112
return;

0 commit comments

Comments
 (0)