mirror of
https://github.com/microsoft/vscode.git
synced 2026-08-25 10:25:41 +01:00
@@ -11,6 +11,7 @@ export type XtermAttributes = Omit<IBufferCell, 'getWidth' | 'getChars' | 'getCo
|
||||
|
||||
export interface IXtermCore {
|
||||
viewport?: {
|
||||
readonly scrollBarWidth: number;
|
||||
_innerRefresh(): void;
|
||||
};
|
||||
_onData: IEventEmitter<string>;
|
||||
|
||||
+6
@@ -18,6 +18,7 @@ import { ICurrentPartialCommand, getCommandRowCount, getPromptRowCount } from 'v
|
||||
import { TerminalSettingId } from 'vs/platform/terminal/common/terminal';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { IXtermColorProvider, IXtermTerminal } from 'vs/workbench/contrib/terminal/browser/terminal';
|
||||
import { IXtermCore } from 'vs/workbench/contrib/terminal/browser/xterm-private';
|
||||
import { TERMINAL_CONFIG_SECTION } from 'vs/workbench/contrib/terminal/common/terminal';
|
||||
import { terminalStickyScrollHoverBackground } from 'vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollColorRegistry';
|
||||
|
||||
@@ -242,6 +243,11 @@ export class TerminalStickyScrollOverlay extends Disposable {
|
||||
this._xterm.raw.element.parentElement.append(this._element);
|
||||
this._register(toDisposable(() => this._element?.remove()));
|
||||
|
||||
const scrollBarWidth = (this._xterm.raw as any as { _core: IXtermCore })._core.viewport?.scrollBarWidth;
|
||||
if (scrollBarWidth !== undefined) {
|
||||
this._element.style.right = `${scrollBarWidth}px`;
|
||||
}
|
||||
|
||||
this._stickyScrollOverlay.open(this._element);
|
||||
|
||||
// Scroll to the command on click
|
||||
|
||||
Reference in New Issue
Block a user