From 8e286cc353221d8d46c1a540931f3412dd10f266 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Thu, 8 Aug 2019 07:59:29 -0700 Subject: [PATCH] Only pass conptyInheritCursor for tasks Part of #76548 --- .../workbench/contrib/terminal/browser/terminalInstance.ts | 6 ++++++ src/vs/workbench/contrib/terminal/node/terminalProcess.ts | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts b/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts index 48edebe7c193a..9d6decb1a3409 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts @@ -1130,6 +1130,12 @@ export class TerminalInstance extends Disposable implements ITerminalInstance { } } + // HACK: Force initialText to be non-falsy for reused terminals such that the + // conptyInheritCursor flag is passed to the node-pty, this flag can cause a Window to hang + // in Windows 10 1903 so we only want to use it when something is definitely written to the + // terminal. + shell.initialText = ' '; + // Set the new shell launch config this._shellLaunchConfig = shell; // Must be done before calling _createProcess() diff --git a/src/vs/workbench/contrib/terminal/node/terminalProcess.ts b/src/vs/workbench/contrib/terminal/node/terminalProcess.ts index b8ad7fd4c2823..2fbc8a25e7462 100644 --- a/src/vs/workbench/contrib/terminal/node/terminalProcess.ts +++ b/src/vs/workbench/contrib/terminal/node/terminalProcess.ts @@ -66,7 +66,8 @@ export class TerminalProcess extends Disposable implements ITerminalChildProcess cols, rows, experimentalUseConpty: useConpty, - conptyInheritCursor: true + // This option will force conpty to not redraw the whole viewport on launch + conptyInheritCursor: useConpty && !!shellLaunchConfig.initialText }; const cwdVerification = stat(cwd).then(async stat => {