mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-14 12:11:43 +01:00
Also support string in shellArgs passed directly to createTerminal
Part of #70716
This commit is contained in:
Vendored
+3
-2
@@ -6599,10 +6599,11 @@ declare module 'vscode' {
|
||||
*
|
||||
* @param name Optional human-readable string which will be used to represent the terminal in the UI.
|
||||
* @param shellPath Optional path to a custom shell executable to be used in the terminal.
|
||||
* @param shellArgs Optional args for the custom shell executable.
|
||||
* @param shellArgs Optional args for the custom shell executable. A string can be used on Windows only which
|
||||
* allows specifying shell args in [command-line format](https://msdn.microsoft.com/en-au/08dfcab2-eb6e-49a4-80eb-87d4076c98c6).
|
||||
* @return A new Terminal.
|
||||
*/
|
||||
export function createTerminal(name?: string, shellPath?: string, shellArgs?: string[]): Terminal;
|
||||
export function createTerminal(name?: string, shellPath?: string, shellArgs?: string[] | string): Terminal;
|
||||
|
||||
/**
|
||||
* Creates a [Terminal](#Terminal). The cwd of the terminal will be the workspace directory
|
||||
|
||||
@@ -474,7 +474,7 @@ export function createApiFactory(
|
||||
createWebviewPanel(viewType: string, title: string, showOptions: vscode.ViewColumn | { viewColumn: vscode.ViewColumn, preserveFocus?: boolean }, options: vscode.WebviewPanelOptions & vscode.WebviewOptions): vscode.WebviewPanel {
|
||||
return extHostWebviews.createWebviewPanel(extension, viewType, title, showOptions, options);
|
||||
},
|
||||
createTerminal(nameOrOptions?: vscode.TerminalOptions | string, shellPath?: string, shellArgs?: string[]): vscode.Terminal {
|
||||
createTerminal(nameOrOptions?: vscode.TerminalOptions | string, shellPath?: string, shellArgs?: string[] | string): vscode.Terminal {
|
||||
if (typeof nameOrOptions === 'object') {
|
||||
return extHostTerminalService.createTerminalFromOptions(<vscode.TerminalOptions>nameOrOptions);
|
||||
}
|
||||
|
||||
@@ -293,7 +293,7 @@ export class ExtHostTerminalService implements ExtHostTerminalServiceShape {
|
||||
this._proxy = mainContext.getProxy(MainContext.MainThreadTerminalService);
|
||||
}
|
||||
|
||||
public createTerminal(name?: string, shellPath?: string, shellArgs?: string[]): vscode.Terminal {
|
||||
public createTerminal(name?: string, shellPath?: string, shellArgs?: string[] | string): vscode.Terminal {
|
||||
const terminal = new ExtHostTerminal(this._proxy, name);
|
||||
terminal.create(shellPath, shellArgs);
|
||||
this._terminals.push(terminal);
|
||||
|
||||
Reference in New Issue
Block a user