Don't obscure scroll bar

Fixes #198007
This commit is contained in:
Daniel Imms
2023-11-11 09:09:23 -08:00
parent 69c7da819a
commit 6cf191ad49
2 changed files with 7 additions and 0 deletions
@@ -11,6 +11,7 @@ export type XtermAttributes = Omit<IBufferCell, 'getWidth' | 'getChars' | 'getCo
export interface IXtermCore {
viewport?: {
readonly scrollBarWidth: number;
_innerRefresh(): void;
};
_onData: IEventEmitter<string>;
@@ -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