Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct sticky scroll bg color in terminal editors #198535

Merged
merged 1 commit into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
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
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
Loading