Skip to content

Commit

Permalink
Merge pull request #198535 from microsoft/tyriar/198358
Browse files Browse the repository at this point in the history
Correct sticky scroll bg color in terminal editors
  • Loading branch information
Tyriar authored Nov 17, 2023
2 parents c2e58d5 + 12f6838 commit 9d596ed
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/vs/workbench/contrib/terminal/browser/terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,7 @@ export interface ITerminalInstance extends IBaseTerminalInstance {
onDidInputData: Event<ITerminalInstance>;
onDidChangeSelection: Event<ITerminalInstance>;
onDidRunText: Event<void>;
onDidChangeTarget: Event<TerminalLocation | undefined>;

/**
* An event that fires when a terminal is dropped on this instance via drag and drop.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down Expand Up @@ -322,6 +325,8 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
readonly onDidChangeHasChildProcesses = this._onDidChangeHasChildProcesses.event;
private readonly _onDidRunText = this._register(new Emitter<void>());
readonly onDidRunText = this._onDidRunText.event;
private readonly _onDidChangeTarget = this._register(new Emitter<TerminalLocation | undefined>());
readonly onDidChangeTarget = this._onDidChangeTarget.event;

constructor(
private readonly _terminalShellTypeContextKey: IContextKey<string>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit 9d596ed

Please sign in to comment.