diff --git a/src/vs/workbench/contrib/terminal/browser/terminal.ts b/src/vs/workbench/contrib/terminal/browser/terminal.ts index aaa3ee98c5dd8..236cc4eab7ee6 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminal.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminal.ts @@ -653,6 +653,7 @@ export interface ITerminalInstance extends IBaseTerminalInstance { onDidInputData: Event; onDidChangeSelection: Event; onDidRunText: Event; + onDidChangeTarget: Event; /** * An event that fires when a terminal is dropped on this instance via drag and drop. diff --git a/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts b/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts index 73a905dcd5747..51229ea570dd2 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts @@ -201,7 +201,10 @@ export class TerminalInstance extends Disposable implements ITerminalInstance { } get target(): TerminalLocation | undefined { return this._target; } - set target(value: TerminalLocation | undefined) { this._target = value; } + set target(value: TerminalLocation | undefined) { + this._target = value; + this._onDidChangeTarget.fire(value); + } get instanceId(): number { return this._instanceId; } get resource(): URI { return this._resource; } @@ -322,6 +325,8 @@ export class TerminalInstance extends Disposable implements ITerminalInstance { readonly onDidChangeHasChildProcesses = this._onDidChangeHasChildProcesses.event; private readonly _onDidRunText = this._register(new Emitter()); readonly onDidRunText = this._onDidRunText.event; + private readonly _onDidChangeTarget = this._register(new Emitter()); + readonly onDidChangeTarget = this._onDidChangeTarget.event; constructor( private readonly _terminalShellTypeContextKey: IContextKey, diff --git a/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/media/stickyScroll.css b/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/media/stickyScroll.css index 8c65bf940a645..a874b52f5dd5a 100644 --- a/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/media/stickyScroll.css +++ b/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/media/stickyScroll.css @@ -12,6 +12,9 @@ background: var(--vscode-terminalStickyScroll-background, var(--vscode-terminal-background, var(--vscode-panel-background))); box-shadow: var(--vscode-scrollbar-shadow) 0 3px 2px -2px; } +.editor-instance .terminal-sticky-scroll { + background: var(--vscode-terminalStickyScroll-background, var(--vscode-terminal-background, var(--vscode-editor-background))); +} .terminal-sticky-scroll.visible { display:block; diff --git a/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollOverlay.ts b/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollOverlay.ts index a54e52081e02a..7a9fa1aafdacb 100644 --- a/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollOverlay.ts +++ b/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollOverlay.ts @@ -85,6 +85,9 @@ export class TerminalStickyScrollOverlay extends Disposable { } })); + // React to terminal location changes + this._register(this._instance.onDidChangeTarget(() => this._syncOptions())); + // Eagerly create the overlay xtermCtor.then(ctor => { this._stickyScrollOverlay = this._register(new ctor({