Skip to content

Commit

Permalink
add proposed.terminalShellType.d.ts from @Tyriar in API to access the…
Browse files Browse the repository at this point in the history
… shell type for a given terminal microsoft#230165
  • Loading branch information
anthonykim1 committed Jan 13, 2025
1 parent 73a79dd commit 8ee3c1e
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/vs/platform/extensions/common/extensionsApiProposals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,9 @@ const _allApiProposals = {
terminalSelection: {
proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalSelection.d.ts',
},
terminalShellType: {
proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalShellType.d.ts',
},
testObserver: {
proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.testObserver.d.ts',
},
Expand Down
39 changes: 39 additions & 0 deletions src/vscode-dts/vscode.proposed.terminalShellType.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

declare module 'vscode' {

// https://github.com/microsoft/vscode/issues/230165

/**
* Known terminal shell types.
*/
export enum TerminalShellType {
Sh = 1,
CommandPrompt,
PowerShell,
GitBash,
Bash,
Zsh,
Python,
Julia,
NuShell,
Fish,
Csh,
Ksh
}

// NOTE: State since this the shellType can change multiple times and this comes with an event.
export interface TerminalState {
/**
* The current detected shell type of the terminal. New shell types may be added in the
* future in which case they will be returned as a number that is not part of
* {@link TerminalShellType}.
* TODO: number is to prevent the breaking change when new enum members are added?
*/
readonly shellType?: TerminalShellType | number | undefined;
}

}

0 comments on commit 8ee3c1e

Please sign in to comment.