mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 02:58:56 +01:00
Progress on Terminal.show API
This commit is contained in:
@@ -147,7 +147,8 @@ export abstract class MainThreadOutputServiceShape {
|
||||
}
|
||||
|
||||
export abstract class MainThreadTerminalServiceShape {
|
||||
$createTerminal(name?: string) { throw ni(); }
|
||||
$createTerminal(name?: string): void { throw ni(); }
|
||||
$show(terminalId: number, preserveFocus: boolean): void { throw ni(); }
|
||||
}
|
||||
|
||||
export interface MyQuickPickItems extends IPickOpenEntry {
|
||||
|
||||
@@ -18,6 +18,22 @@ export class ExtHostTerminal implements vscode.Terminal {
|
||||
this.name = name;
|
||||
this._proxy = proxy;
|
||||
}
|
||||
|
||||
public sendText(text: string, addNewLine: boolean = true) {
|
||||
// TODO: Implement
|
||||
}
|
||||
|
||||
public show(preserveFocus: boolean): void {
|
||||
this._proxy.$show(0, preserveFocus);
|
||||
}
|
||||
|
||||
public hide(): void {
|
||||
// TODO: Implement
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
// TODO: Implement
|
||||
}
|
||||
}
|
||||
|
||||
export class ExtHostTerminalService {
|
||||
@@ -28,7 +44,8 @@ export class ExtHostTerminalService {
|
||||
this._proxy = threadService.get(MainContext.MainThreadTerminalService);
|
||||
}
|
||||
|
||||
createTerminal(name?: string): vscode.Terminal {
|
||||
public createTerminal(name?: string): vscode.Terminal {
|
||||
this._proxy.$createTerminal(name);
|
||||
return new ExtHostTerminal(this._proxy, name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,4 +17,12 @@ export class MainThreadTerminalService extends MainThreadTerminalServiceShape {
|
||||
super();
|
||||
this._terminalService = terminalService;
|
||||
}
|
||||
|
||||
public $createTerminal(name?: string): void {
|
||||
this._terminalService.createNew();
|
||||
}
|
||||
|
||||
public $show(terminalId: number, preserveFocus: boolean): void {
|
||||
this._terminalService.show(!preserveFocus, terminalId);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user