Merge pull request #206546 from microsoft/tyriar/206544

Make sticky scroll do something on click for partial cmd
pull/206555/head
Daniel Imms 2024-02-29 10:29:40 -08:00 committed by GitHub
commit 8be70d0aeb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View File

@ -28,6 +28,7 @@ import { ScrollPosition } from 'vs/workbench/contrib/terminal/browser/xterm/mark
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { GroupIdentifier } from 'vs/workbench/common/editor';
import { ACTIVE_GROUP_TYPE, AUX_WINDOW_GROUP_TYPE, SIDE_GROUP_TYPE } from 'vs/workbench/services/editor/common/editorService';
import type { ICurrentPartialCommand } from 'vs/platform/terminal/common/capabilities/commandDetection/terminalCommand';
export const ITerminalService = createDecorator<ITerminalService>('terminalService');
export const ITerminalEditorService = createDecorator<ITerminalEditorService>('terminalEditorService');
@ -117,7 +118,7 @@ export interface IMarkTracker {
scrollToClosestMarker(startMarkerId: string, endMarkerId?: string, highlight?: boolean | undefined): void;
scrollToLine(line: number, position: ScrollPosition): void;
revealCommand(command: ITerminalCommand, position?: ScrollPosition): void;
revealCommand(command: ITerminalCommand | ICurrentPartialCommand, position?: ScrollPosition): void;
revealRange(range: IBufferRange): void;
registerTemporaryDecoration(marker: IMarker, endMarker: IMarker | undefined, showOutline: boolean): void;
showCommandGuide(command: ITerminalCommand | undefined): void;

View File

@ -389,7 +389,7 @@ export class TerminalStickyScrollOverlay extends Disposable {
// Scroll to the command on click
this._register(addStandardDisposableListener(hoverOverlay, 'click', () => {
if (this._xterm && this._currentStickyCommand && 'getOutput' in this._currentStickyCommand) {
if (this._xterm && this._currentStickyCommand) {
this._xterm.markTracker.revealCommand(this._currentStickyCommand);
this._instance.focus();
}