Skip to content

Commit

Permalink
Move terminal target management into XtermTerminal
Browse files Browse the repository at this point in the history
Part of #136055
  • Loading branch information
Tyriar committed Nov 2, 2021
1 parent bf34d47 commit 4260229
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
8 changes: 8 additions & 0 deletions src/vs/workbench/contrib/terminal/browser/terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,9 @@ export interface ITerminalInstance {
*/
processId: number | undefined;

/**
* The position of the terminal.
*/
target?: TerminalLocation;

/**
Expand Down Expand Up @@ -776,6 +779,11 @@ export interface IXtermTerminal {
*/
readonly commandTracker: ICommandTracker;

/**
* The position of the terminal.
*/
target?: TerminalLocation;

/**
* Find the next instance of the term
*/
Expand Down
10 changes: 8 additions & 2 deletions src/vs/workbench/contrib/terminal/browser/terminalInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import { TypeAheadAddon } from 'vs/workbench/contrib/terminal/browser/terminalTy
import { BrowserFeatures } from 'vs/base/browser/canIUse';
import { IPreferencesService } from 'vs/workbench/services/preferences/common/preferences';
import { IEnvironmentVariableInfo } from 'vs/workbench/contrib/terminal/common/environmentVariable';
import { IProcessDataEvent, IShellLaunchConfig, ITerminalDimensionsOverride, ITerminalLaunchError, TerminalShellType, TerminalSettingId, TitleEventSource, TerminalIcon, TerminalSettingPrefix, ITerminalProfileObject, TerminalLocation, ProcessPropertyType, ProcessCapability, IProcessPropertyMap } from 'vs/platform/terminal/common/terminal';
import { IProcessDataEvent, IShellLaunchConfig, ITerminalDimensionsOverride, ITerminalLaunchError, TerminalShellType, TerminalSettingId, TitleEventSource, TerminalIcon, TerminalSettingPrefix, ITerminalProfileObject, ProcessPropertyType, ProcessCapability, IProcessPropertyMap, TerminalLocation } from 'vs/platform/terminal/common/terminal';
import { IProductService } from 'vs/platform/product/common/productService';
import { formatMessageForTerminal } from 'vs/workbench/contrib/terminal/common/terminalStrings';
import { AutoOpenBarrier, Promises } from 'vs/base/common/async';
Expand Down Expand Up @@ -170,7 +170,13 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
private _hasScrollBar?: boolean;

xterm?: XtermTerminal;
target?: TerminalLocation;

get target(): TerminalLocation | undefined { return this.xterm?.target; }
set target(value: TerminalLocation | undefined) {
if (this.xterm) {
this.xterm.target = value;
}
}

get instanceId(): number { return this._instanceId; }
get resource(): URI { return this._resource; }
Expand Down

0 comments on commit 4260229

Please sign in to comment.