Skip to content

Commit 46f2641

Browse files
authored
Merge pull request microsoft#208796 from microsoft/tyriar/208257_2
Shell integration docs and readonly
2 parents 95b449d + d0851d5 commit 46f2641

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/vscode-dts/vscode.proposed.terminalShellIntegration.d.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ declare module 'vscode' {
1212
/**
1313
* The {@link Terminal} the command was executed in.
1414
*/
15-
terminal: Terminal;
15+
readonly terminal: Terminal;
1616

1717
/**
1818
* The full command line that was executed, including both the command and arguments.
@@ -26,7 +26,7 @@ declare module 'vscode' {
2626
* - It may be inaccurate if the shell integration does not support command line reporting
2727
* via the [`OSC 633 ; E` sequence](https://code.visualstudio.com/docs/terminal/shell-integration#_vs-code-custom-sequences-osc-633-st).
2828
*/
29-
commandLine: string | undefined;
29+
readonly commandLine: string | undefined;
3030

3131
/**
3232
* The working directory that was reported by the shell when this command executed. This
@@ -35,12 +35,12 @@ declare module 'vscode' {
3535
* reporting via the [`OSC 633 ; P`](https://code.visualstudio.com/docs/terminal/shell-integration#_vs-code-custom-sequences-osc-633-st)
3636
* or `OSC 1337 ; CurrentDir=<Cwd> ST` sequences.
3737
*/
38-
cwd: Uri | string | undefined;
38+
readonly cwd: Uri | string | undefined;
3939

4040
/**
4141
* The exit code reported by the shell.
4242
*/
43-
exitCode: Thenable<number | undefined>;
43+
readonly exitCode: Thenable<number | undefined>;
4444

4545
/**
4646
* Creates a stream of raw data (including escape sequences) that is written to the
@@ -65,8 +65,12 @@ declare module 'vscode' {
6565
* features for the terminal. This will always be undefined immediately after the terminal
6666
* is created. Listen to {@link window.onDidActivateTerminalShellIntegration} to be notified
6767
* when shell integration is activated for a terminal.
68+
*
69+
* Note that this object may remain undefined if shell integation never activates. For
70+
* example Command Prompt does not support shell integration and a user's shell setup could
71+
* conflict with the automatic shell integration activation.
6872
*/
69-
shellIntegration: TerminalShellIntegration | undefined;
73+
readonly shellIntegration: TerminalShellIntegration | undefined;
7074
}
7175

7276
export interface TerminalShellIntegration {
@@ -75,7 +79,7 @@ declare module 'vscode' {
7579
* The current working directory of the terminal. This will be a {@link Uri} if the string
7680
* reported by the shell can reliably be mapped to the connected machine.
7781
*/
78-
cwd: Uri | string | undefined;
82+
readonly cwd: Uri | string | undefined;
7983

8084
/**
8185
* Execute a command, sending ^C as necessary to interrupt any running command if needed.
@@ -177,11 +181,11 @@ declare module 'vscode' {
177181
/**
178182
* The terminal that shell integration has been activated in.
179183
*/
180-
terminal: Terminal;
184+
readonly terminal: Terminal;
181185
/**
182186
* The shell integration object.
183187
*/
184-
shellIntegration: TerminalShellIntegration;
188+
readonly shellIntegration: TerminalShellIntegration;
185189
}
186190

187191
export namespace window {

0 commit comments

Comments
 (0)