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

enable adding and navigating to custom marks in the buffer #158313

Merged
merged 66 commits into from
Sep 7, 2022
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
65dfef8
add buffer mark capability
meganrogge Aug 15, 2022
8f13bcb
Merge branch 'main' into merogge/buffer-mark
meganrogge Aug 16, 2022
89eb98e
alter decoration addon, add scrollToMark
meganrogge Aug 16, 2022
96d8811
fix issues
meganrogge Aug 16, 2022
152a1d3
CommandNavigationAddon -> MarkNavigationAddon
meganrogge Aug 16, 2022
6e985ea
get decorations to work
meganrogge Aug 16, 2022
89916df
get mark navigation to work
meganrogge Aug 16, 2022
5981457
get scroll to mark to work
meganrogge Aug 16, 2022
b6a6170
fix hidden property
meganrogge Aug 16, 2022
95164ac
add tests
meganrogge Aug 16, 2022
0d5a706
get rid of assert
meganrogge Aug 16, 2022
04ae814
improve JSdoc
meganrogge Aug 16, 2022
f02a472
fix description
meganrogge Aug 16, 2022
bf37a7d
stricter check
meganrogge Aug 16, 2022
6d82617
revert changes to iterm setMark
meganrogge Aug 16, 2022
94f15f2
Update src/vs/workbench/contrib/terminal/test/browser/xterm/shellInte…
meganrogge Aug 16, 2022
681ab27
Update src/vs/workbench/contrib/terminal/browser/terminal.ts
meganrogge Aug 16, 2022
495e3ec
Update src/vs/workbench/contrib/terminal/browser/terminal.ts
meganrogge Aug 16, 2022
0030b04
Update src/vs/workbench/contrib/terminal/browser/terminal.ts
meganrogge Aug 16, 2022
d87521f
handle generic marks as well
meganrogge Aug 16, 2022
aed2a1e
get decoration to show up
meganrogge Aug 16, 2022
c5fcf3f
Merge branch 'main' into merogge/buffer-mark
meganrogge Aug 16, 2022
18a1eac
Update src/vs/platform/terminal/common/capabilities/bufferMarkCapabil…
meganrogge Aug 17, 2022
92145cc
Update src/vs/platform/terminal/common/xterm/shellIntegrationAddon.ts
meganrogge Aug 17, 2022
0b80808
more cleanup
meganrogge Aug 17, 2022
ed095e1
implement scroll to closest marker
meganrogge Aug 17, 2022
7fc78e1
Merge branch 'main' into merogge/buffer-mark
meganrogge Aug 18, 2022
bbbcea6
remove export
meganrogge Aug 18, 2022
8236a61
Revert "try with task active event"
meganrogge Aug 18, 2022
20df8f8
Merge branch 'main' into merogge/buffer-mark
meganrogge Aug 19, 2022
e427efb
Revert "get decoration to show up"
meganrogge Aug 19, 2022
f126f53
add scroll to marker
meganrogge Aug 19, 2022
70b333f
get tasks to work
meganrogge Aug 19, 2022
c62ec62
get test to pass
meganrogge Aug 19, 2022
2a7cd4e
get it to work for generic markers
meganrogge Aug 19, 2022
a5cc851
Merge branch 'main' into merogge/buffer-mark
meganrogge Aug 19, 2022
014fefe
clean up
meganrogge Aug 19, 2022
6e2ed1d
use mark properties everywhere
meganrogge Aug 19, 2022
51578b5
fix hover
meganrogge Aug 19, 2022
369ccdc
Update src/vs/platform/terminal/common/capabilities/capabilities.ts
meganrogge Aug 19, 2022
65a8928
Update src/vs/platform/terminal/common/capabilities/capabilities.ts
meganrogge Aug 19, 2022
04e5544
fix issue
meganrogge Aug 19, 2022
a6320ce
adjust test because we now support SetMark with no ID
meganrogge Aug 19, 2022
a16a91e
add test
meganrogge Aug 24, 2022
cb13f90
cleanup
meganrogge Aug 24, 2022
4043bc8
Update src/vs/platform/terminal/common/capabilities/bufferMarkCapabil…
meganrogge Sep 6, 2022
154cf73
Update src/vs/workbench/contrib/terminal/browser/xterm/markNavigation…
meganrogge Sep 6, 2022
fe3169e
rename etc
meganrogge Sep 6, 2022
7918334
use iterator
meganrogge Sep 6, 2022
c065c18
parse args
meganrogge Sep 6, 2022
554e6d9
hidden -> true
meganrogge Sep 6, 2022
a506a07
get all markers
meganrogge Sep 6, 2022
58c29ab
Merge branch 'main' into merogge/buffer-mark
meganrogge Sep 6, 2022
8a21f75
Merge branch 'main' into merogge/buffer-mark
meganrogge Sep 6, 2022
f5467da
try to fix layer issue
meganrogge Sep 7, 2022
f0b8d58
fix import issues
meganrogge Sep 7, 2022
153251e
fix errors
meganrogge Sep 7, 2022
3b2e471
layer
meganrogge Sep 7, 2022
63c18da
add more tests
meganrogge Sep 7, 2022
2cbed9f
get markers to show up
meganrogge Sep 7, 2022
dfafeea
remove nav decorations appropriately
meganrogge Sep 7, 2022
51cd3dd
get multi line decorations to work
meganrogge Sep 7, 2022
5b1894e
Update src/vs/workbench/contrib/terminal/browser/xterm/markNavigation…
meganrogge Sep 7, 2022
fb5f6e2
Update src/vs/platform/terminal/common/xterm/shellIntegrationAddon.ts
meganrogge Sep 7, 2022
0dd2bc9
clean up
meganrogge Sep 7, 2022
ccaf3cd
remaining cleanup
meganrogge Sep 7, 2022
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { Emitter } from 'vs/base/common/event';
import { ILogService } from 'vs/platform/log/common/log';
import { IBufferMarkDetectionCapability, TerminalCapability } from 'vs/platform/terminal/common/capabilities/capabilities';
// Importing types is safe in any layer
// eslint-disable-next-line code-import-patterns
import type { IMarker, Terminal } from 'xterm-headless';

export class BufferMarkCapability implements IBufferMarkDetectionCapability {
meganrogge marked this conversation as resolved.
Show resolved Hide resolved
readonly type = TerminalCapability.BufferMarkDetection;
meganrogge marked this conversation as resolved.
Show resolved Hide resolved
readonly marks: Map<string, IMarker> = new Map();
private readonly _onMarkAdded = new Emitter<{ id: string; marker: IMarker; hidden?: boolean }>();
readonly onMarkAdded = this._onMarkAdded.event;
constructor(
private readonly _terminal: Terminal,
@ILogService private readonly _logService: ILogService
) {
}
addMark(id: string, marker?: IMarker, hidden?: boolean): void {
marker = marker || this._terminal.registerMarker();
if (marker) {
this.marks.set(id, marker);
} else {
this._logService.warn('No marker registered for ID:', id);
return;
}
marker.onDispose(() => this.marks.delete(id));
this._onMarkAdded.fire({ id, marker, hidden });
}

getMarker(id: string): IMarker | undefined {
return this.marks.get(id);
}
}
32 changes: 23 additions & 9 deletions src/vs/platform/terminal/common/capabilities/capabilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import { Event } from 'vs/base/common/event';
import { IDisposable } from 'vs/base/common/lifecycle';
import { IGenericMarkProperties, ISerializedCommandDetectionCapability } from 'vs/platform/terminal/common/terminalProcess';
import { ISerializedCommandDetectionCapability } from 'vs/platform/terminal/common/terminalProcess';

interface IEvent<T, U = void> {
(listener: (arg1: T, arg2: U) => any): IDisposable;
Expand Down Expand Up @@ -60,7 +60,17 @@ export const enum TerminalCapability {
* may not be so good at remembering the position of commands that ran in the past. This state
* may be enabled when something goes wrong or when using conpty for example.
*/
PartialCommandDetection
PartialCommandDetection,

/**
* Adds custom marks to the buffer
meganrogge marked this conversation as resolved.
Show resolved Hide resolved
* that can be used for terminal navigation and selection.
* The source of the request (task, debug, etc)
* provides an ID, optional marker, and hidden property.
* When hidden is not provided, a generic
* decoration is added to the buffer and overview ruler.
meganrogge marked this conversation as resolved.
Show resolved Hide resolved
*/
BufferMarkDetection
}

/**
Expand Down Expand Up @@ -103,6 +113,7 @@ export interface ITerminalCapabilityImplMap {
[TerminalCapability.CommandDetection]: ICommandDetectionCapability;
[TerminalCapability.NaiveCwdDetection]: INaiveCwdDetectionCapability;
[TerminalCapability.PartialCommandDetection]: IPartialCommandDetectionCapability;
[TerminalCapability.BufferMarkDetection]: IBufferMarkDetectionCapability;
}

export interface ICwdDetectionCapability {
Expand All @@ -122,6 +133,16 @@ export interface ICommandInvalidationRequest {
reason: CommandInvalidationReason;
}

export interface IBufferMark { id: string; marker: IMarker; hoverMessage?: string; hidden?: boolean }

export interface IBufferMarkDetectionCapability {
type: TerminalCapability.BufferMarkDetection;
readonly marks: Map<string, IMarker>;
onMarkAdded: Event<IBufferMark>;
addMark(id: string, marker?: IMarker, hidden?: boolean): void;
getMarker(id: string): IMarker | undefined;
meganrogge marked this conversation as resolved.
Show resolved Hide resolved
}

export interface ICommandDetectionCapability {
readonly type: TerminalCapability.CommandDetection;
readonly commands: readonly ITerminalCommand[];
Expand All @@ -136,7 +157,6 @@ export interface ICommandDetectionCapability {
readonly onCurrentCommandInvalidated: Event<ICommandInvalidationRequest>;
setCwd(value: string): void;
setIsWindowsPty(value: boolean): void;
setIsCommandStorageDisabled(): void;
/**
* Gets the working directory for a line, this will return undefined if it's unknown in which
* case the terminal's initial cwd should be used.
Expand All @@ -148,7 +168,6 @@ export interface ICommandDetectionCapability {
handleRightPromptStart(): void;
handleRightPromptEnd(): void;
handleCommandStart(options?: IHandleCommandOptions): void;
handleGenericCommand(options?: IHandleCommandOptions): void;
handleCommandExecuted(options?: IHandleCommandOptions): void;
handleCommandFinished(exitCode?: number, options?: IHandleCommandOptions): void;
invalidateCurrentCommand(request: ICommandInvalidationRequest): void;
Expand All @@ -170,10 +189,6 @@ export interface IHandleCommandOptions {
* The marker to use
*/
marker?: IMarker;
/**
* Properties for a generic mark
*/
genericMarkProperties?: IGenericMarkProperties;
}

export interface INaiveCwdDetectionCapability {
Expand All @@ -199,7 +214,6 @@ export interface ITerminalCommand {
commandStartLineContent?: string;
getOutput(): string | undefined;
hasOutput(): boolean;
genericMarkProperties?: IGenericMarkProperties;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ export class CommandDetectionCapability implements ICommandDetectionCapability {
private _onCursorMoveListener?: IDisposable;
private _commandMarkers: IMarker[] = [];
private _dimensions: ITerminalDimensions;
private __isCommandStorageDisabled: boolean = false;
private _handleCommandStartOptions?: IHandleCommandOptions;

get commands(): readonly ITerminalCommand[] { return this._commands; }
Expand Down Expand Up @@ -250,10 +249,6 @@ export class CommandDetectionCapability implements ICommandDetectionCapability {
this._isWindowsPty = value;
}

setIsCommandStorageDisabled(): void {
this.__isCommandStorageDisabled = true;
}
meganrogge marked this conversation as resolved.
Show resolved Hide resolved

getCwdForLine(line: number): string | undefined {
// Handle the current partial command first, anything below it's prompt is considered part
// of the current command
Expand Down Expand Up @@ -317,7 +312,7 @@ export class CommandDetectionCapability implements ICommandDetectionCapability {
}
this._currentCommand.commandStartX = this._terminal.buffer.active.cursorX;
this._currentCommand.commandStartMarker = options?.marker || this._terminal.registerMarker(0);
this._onCommandStarted.fire({ marker: options?.marker || this._currentCommand.commandStartMarker, genericMarkProperties: options?.genericMarkProperties } as ITerminalCommand);
this._onCommandStarted.fire({ marker: options?.marker || this._currentCommand.commandStartMarker } as ITerminalCommand);
this._logService.debug('CommandDetectionCapability#handleCommandStart', this._currentCommand.commandStartX, this._currentCommand.commandStartMarker?.line);
}

Expand Down Expand Up @@ -352,16 +347,6 @@ export class CommandDetectionCapability implements ICommandDetectionCapability {
});
}

handleGenericCommand(options?: IHandleCommandOptions): void {
if (options?.genericMarkProperties?.disableCommandStorage) {
this.setIsCommandStorageDisabled();
}
this.handlePromptStart(options);
this.handleCommandStart(options);
this.handleCommandExecuted(options);
this.handleCommandFinished(undefined, options);
}

handleCommandExecuted(options?: IHandleCommandOptions): void {
if (this._isWindowsPty) {
this._handleCommandExecutedWindows();
Expand All @@ -378,7 +363,7 @@ export class CommandDetectionCapability implements ICommandDetectionCapability {
}

// Calculate the command
this._currentCommand.command = this.__isCommandStorageDisabled ? '' : this._terminal.buffer.active.getLine(this._currentCommand.commandStartMarker.line)?.translateToString(true, this._currentCommand.commandStartX, this._currentCommand.commandRightPromptStartX).trim();
this._currentCommand.command = this._terminal.buffer.active.getLine(this._currentCommand.commandStartMarker.line)?.translateToString(true, this._currentCommand.commandStartX, this._currentCommand.commandRightPromptStartX).trim();
let y = this._currentCommand.commandStartMarker.line + 1;
const commandExecutedLine = this._currentCommand.commandExecutedMarker.line;
for (; y < commandExecutedLine; y++) {
Expand Down Expand Up @@ -459,7 +444,6 @@ export class CommandDetectionCapability implements ICommandDetectionCapability {
commandStartLineContent: this._currentCommand.commandStartLineContent,
hasOutput: () => !executedMarker?.isDisposed && !endMarker?.isDisposed && !!(executedMarker && endMarker && executedMarker?.line < endMarker!.line),
getOutput: () => getOutputForCommand(executedMarker, endMarker, buffer),
genericMarkProperties: options?.genericMarkProperties
};
this._commands.push(newCommand);
this._logService.debug('CommandDetectionCapability#onCommandFinished', newCommand);
Expand Down Expand Up @@ -522,7 +506,7 @@ export class CommandDetectionCapability implements ICommandDetectionCapability {
startX: undefined,
endLine: e.endMarker?.line,
executedLine: e.executedMarker?.line,
command: this.__isCommandStorageDisabled ? '' : e.command,
command: e.command,
cwd: e.cwd,
exitCode: e.exitCode,
commandStartLineContent: e.commandStartLineContent,
Expand Down Expand Up @@ -571,7 +555,7 @@ export class CommandDetectionCapability implements ICommandDetectionCapability {
const endMarker = e.endLine !== undefined ? this._terminal.registerMarker(e.endLine - (buffer.baseY + buffer.cursorY)) : undefined;
const executedMarker = e.executedLine !== undefined ? this._terminal.registerMarker(e.executedLine - (buffer.baseY + buffer.cursorY)) : undefined;
const newCommand = {
command: this.__isCommandStorageDisabled ? '' : e.command,
command: e.command,
marker,
endMarker,
executedMarker,
Expand All @@ -580,8 +564,7 @@ export class CommandDetectionCapability implements ICommandDetectionCapability {
commandStartLineContent: e.commandStartLineContent,
exitCode: e.exitCode,
hasOutput: () => !executedMarker?.isDisposed && !endMarker?.isDisposed && !!(executedMarker && endMarker && executedMarker.line < endMarker.line),
getOutput: () => getOutputForCommand(executedMarker, endMarker, buffer),
genericMarkProperties: e.genericMarkProperties
getOutput: () => getOutputForCommand(executedMarker, endMarker, buffer)
};
this._commands.push(newCommand);
this._logService.debug('CommandDetectionCapability#onCommandFinished', newCommand);
Expand Down
6 changes: 0 additions & 6 deletions src/vs/platform/terminal/common/terminalProcess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,6 @@ export interface ISerializedCommand {
exitCode: number | undefined;
commandStartLineContent: string | undefined;
timestamp: number;
genericMarkProperties?: IGenericMarkProperties;
}

export interface IGenericMarkProperties {
hoverMessage?: string;
disableCommandStorage?: boolean;
}

export interface ISerializedCommandDetectionCapability {
Expand Down
38 changes: 33 additions & 5 deletions src/vs/platform/terminal/common/xterm/shellIntegrationAddon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,18 @@ import { Disposable, dispose, IDisposable, toDisposable } from 'vs/base/common/l
import { TerminalCapabilityStore } from 'vs/platform/terminal/common/capabilities/terminalCapabilityStore';
import { CommandDetectionCapability } from 'vs/platform/terminal/common/capabilities/commandDetectionCapability';
import { CwdDetectionCapability } from 'vs/platform/terminal/common/capabilities/cwdDetectionCapability';
import { ICommandDetectionCapability, ICwdDetectionCapability, TerminalCapability } from 'vs/platform/terminal/common/capabilities/capabilities';
import { IBufferMarkDetectionCapability, ICommandDetectionCapability, ICwdDetectionCapability, TerminalCapability } from 'vs/platform/terminal/common/capabilities/capabilities';
import { PartialCommandDetectionCapability } from 'vs/platform/terminal/common/capabilities/partialCommandDetectionCapability';
import { ILogService } from 'vs/platform/log/common/log';
// Importing types is safe in any layer
// eslint-disable-next-line code-import-patterns
import type { ITerminalAddon, Terminal } from 'xterm-headless';
import { ISerializedCommandDetectionCapability } from 'vs/platform/terminal/common/terminalProcess';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { Emitter } from 'vs/base/common/event';
import { BufferMarkCapability } from 'vs/platform/terminal/common/capabilities/bufferMarkCapability';
// Importing types is safe in any layer
// eslint-disable-next-line code-import-patterns
import type { ITerminalAddon, Terminal } from 'xterm-headless';

/**
* Shell integration is a feature that enhances the terminal's understanding of what's happening
Expand Down Expand Up @@ -148,7 +151,14 @@ const enum VSCodeOscPt {
*
* WARNING: Any other properties may be changed and are not guaranteed to work in the future.
*/
Property = 'P'
Property = 'P',

/**
* Sets a mark/point-of-interest in the buffer. `OSC 633 ; SetMark [; Id=<string>] [; Hidden]`
meganrogge marked this conversation as resolved.
Show resolved Hide resolved
* `Id` - Indicates the source of the mark
* `Hidden` - When set, a generic decoration will not be added
meganrogge marked this conversation as resolved.
Show resolved Hide resolved
*/
SetMark = 'SetMark',
}

/**
Expand Down Expand Up @@ -351,10 +361,19 @@ export class ShellIntegrationAddon extends Disposable implements IShellIntegrati
return true;
}
case 'Task': {
this.capabilities.get(TerminalCapability.CommandDetection)?.setIsCommandStorageDisabled();
this._createOrGetBufferMarkDetection(this._terminal);
return true;
}
}
}
case VSCodeOscPt.SetMark: {
const [id, hidden] = args;
if (!id) {
return false;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we still want to add the mark even if there is no id, provided it's not hidden. So the if should be if (!id && hidden) imo.

this._createOrGetBufferMarkDetection(this._terminal).addMark(id, undefined, hidden === 'Hidden');
return true;
}
}

// Unrecognized sequence
Expand All @@ -369,7 +388,7 @@ export class ShellIntegrationAddon extends Disposable implements IShellIntegrati
const [command] = data.split(';');
switch (command) {
case ITermOscPt.SetMark: {
this._createOrGetCommandDetection(this._terminal).handleGenericCommand({ genericMarkProperties: { disableCommandStorage: true } });
this._terminal.registerMarker();
meganrogge marked this conversation as resolved.
Show resolved Hide resolved
}
}
// Unrecognized sequence
Expand Down Expand Up @@ -412,6 +431,15 @@ export class ShellIntegrationAddon extends Disposable implements IShellIntegrati
return commandDetection;
}

protected _createOrGetBufferMarkDetection(terminal: Terminal): IBufferMarkDetectionCapability {
let bufferMarkDetection = this.capabilities.get(TerminalCapability.BufferMarkDetection);
if (!bufferMarkDetection) {
bufferMarkDetection = new BufferMarkCapability(terminal, this._logService);
this.capabilities.add(TerminalCapability.BufferMarkDetection, bufferMarkDetection);
}
return bufferMarkDetection;
}

private _deserializeMessage(message: string): string {
let result = message.replace(/\\\\/g, '\\');
const deserializeRegex = /\\x([0-9a-f]{2})/i;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class TaskTerminalStatus extends Disposable {
});
problemMatcher.onDidFindErrors(() => {
if (this._marker) {
terminal.addGenericMark(this._marker, { hoverMessage: nls.localize('task.watchFirstError', "Beginning of detected errors for this run"), disableCommandStorage: true });
terminal.addBufferMark(Date.now().toString(), this._marker, false);
meganrogge marked this conversation as resolved.
Show resolved Hide resolved
}
});
problemMatcher.onDidRequestInvalidateLastMarker(() => {
Expand Down
36 changes: 20 additions & 16 deletions src/vs/workbench/contrib/terminal/browser/terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { createDecorator } from 'vs/platform/instantiation/common/instantiation'
import { IKeyMods } from 'vs/platform/quickinput/common/quickInput';
import { ITerminalCapabilityStore, ITerminalCommand } from 'vs/platform/terminal/common/capabilities/capabilities';
import { IExtensionTerminalProfile, IProcessPropertyMap, IReconnectionProperties, IShellIntegration, IShellLaunchConfig, ITerminalDimensions, ITerminalLaunchError, ITerminalProfile, ITerminalTabLayoutInfoById, ProcessPropertyType, TerminalExitReason, TerminalIcon, TerminalLocation, TerminalShellType, TerminalType, TitleEventSource, WaitOnExitValue } from 'vs/platform/terminal/common/terminal';
import { IGenericMarkProperties } from 'vs/platform/terminal/common/terminalProcess';
import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace';
import { EditorInput } from 'vs/workbench/common/editor/editorInput';
import { IEditableData } from 'vs/workbench/common/views';
Expand Down Expand Up @@ -82,14 +81,15 @@ export interface IQuickPickTerminalObject {
keyMods: IKeyMods | undefined;
}

export interface ICommandTracker {
scrollToPreviousCommand(): void;
scrollToNextCommand(): void;
selectToPreviousCommand(): void;
selectToNextCommand(): void;
export interface IMarkTracker {
scrollToPreviousMark(): void;
scrollToNextMark(): void;
selectToPreviousMark(): void;
selectToNextMark(): void;
selectToPreviousLine(): void;
selectToNextLine(): void;
clearMarker(): void;
scrollToClosestMark(startMarker: IMarker, endMarker?: IMarker, highlight?: boolean): void;
meganrogge marked this conversation as resolved.
Show resolved Hide resolved
}

export interface ITerminalGroup {
Expand Down Expand Up @@ -666,10 +666,20 @@ export interface ITerminalInstance {
registerMarker(): IMarker | undefined;

/**
* Adds a decoration to the buffer at the @param marker with
* @param genericMarkProperties
* Registers a marker and maps it to an ID
meganrogge marked this conversation as resolved.
Show resolved Hide resolved
* When not @param hidden, adds a decoration to the buffer
*/
addGenericMark(marker: IMarker, genericMarkProperties: IGenericMarkProperties): void;
addBufferMark(id: string, marker?: IMarker, hidden?: boolean): void;

/**
*
* @param startMarkId The ID for the start marker
* @param endMarkId The ID for the end marker
* @param highlight Whether the buffer from startMarker to endMarker
* should be selected - will select just the line unless
* endMarkId is provided
*/
scrollToMark(startMarkId: string, endMarkId?: string, highlight?: boolean): void;

/**
* Dispose the terminal instance, removing it from the panel/service and freeing up resources.
Expand Down Expand Up @@ -909,7 +919,7 @@ export interface IXtermTerminal {
* An object that tracks when commands are run and enables navigating and selecting between
* them.
*/
readonly commandTracker: ICommandTracker;
readonly markTracker: IMarkTracker;

/**
* Reports the status of shell integration and fires events relating to it.
Expand Down Expand Up @@ -968,12 +978,6 @@ export interface IXtermTerminal {
*/
clearActiveSearchDecoration(): void;

/**
* Adds a decoration at the @param marker with the given properties
* @param properties
*/
addDecoration(marker: IMarker, properties: IGenericMarkProperties): void;

/**
* Returns a reverse iterator of buffer lines as strings
*/
Expand Down
Loading