Skip to content

Commit

Permalink
Make TerminalState.isInteractedWith stable
Browse files Browse the repository at this point in the history
Fixes #127717
  • Loading branch information
Tyriar committed Sep 17, 2021
1 parent 9188559 commit 36b0223
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 39 deletions.
31 changes: 31 additions & 0 deletions src/vs/vscode.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5858,6 +5858,11 @@ declare module 'vscode' {
*/
readonly exitStatus: TerminalExitStatus | undefined;

/**
* The current state of the {@link Terminal}.
*/
readonly state: TerminalState;

/**
* Send text to the terminal. The text is written to the stdin of the underlying pty process
* (shell) of the terminal.
Expand Down Expand Up @@ -5887,6 +5892,27 @@ declare module 'vscode' {
dispose(): void;
}

/**
* Represents the state of a {@link Terminal}.
*/
export interface TerminalState {
/**
* Whether the {@link Terminal} has been interacted with. Interaction means that the
* terminal has sent data to the process which depending on the terminal's _mode_. By
* default input is sent when a key is pressed or when a command or extension sends text,
* but based on the terminal's mode it can also happen on:
*
* - a pointer click event
* - a pointer scroll event
* - a pointer move event
* - terminal focus in/out
*
* For more information on events that can send data see "DEC Private Mode Set (DECSET)" on
* https://invisible-island.net/xterm/ctlseqs/ctlseqs.html
*/
readonly isInteractedWith: boolean;
}

/**
* Provides information on a line in a terminal in order to provide links for it.
*/
Expand Down Expand Up @@ -8662,6 +8688,11 @@ declare module 'vscode' {
*/
export const onDidCloseTerminal: Event<Terminal>;

/**
* An {@link Event} which fires when a {@link Terminal.state terminal's state} has changed.
*/
export const onDidChangeTerminalState: Event<Terminal>;

/**
* Represents the current window's state.
*/
Expand Down
39 changes: 0 additions & 39 deletions src/vs/vscode.proposed.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -906,45 +906,6 @@ declare module 'vscode' {

//#endregion

//#region Terminal state event https://github.com/microsoft/vscode/issues/127717

/**
* Represents the state of a {@link Terminal}.
*/
export interface TerminalState {
/**
* Whether the {@link Terminal} has been interacted with. Interaction means that the
* terminal has sent data to the process which depending on the terminal's _mode_. By
* default input is sent when a key is pressed or when a command or extension sends text,
* but based on the terminal's mode it can also happen on:
*
* - a pointer click event
* - a pointer scroll event
* - a pointer move event
* - terminal focus in/out
*
* For more information on events that can send data see "DEC Private Mode Set (DECSET)" on
* https://invisible-island.net/xterm/ctlseqs/ctlseqs.html
*/
readonly isInteractedWith: boolean;
}

export interface Terminal {
/**
* The current state of the {@link Terminal}.
*/
readonly state: TerminalState;
}

export namespace window {
/**
* An {@link Event} which fires when a {@link Terminal.state terminal's state} has changed.
*/
export const onDidChangeTerminalState: Event<Terminal>;
}

//#endregion

//#region Terminal location https://github.com/microsoft/vscode/issues/45407

export interface TerminalOptions {
Expand Down

0 comments on commit 36b0223

Please sign in to comment.