-
Notifications
You must be signed in to change notification settings - Fork 34.6k
Description
Issue Type: Feature Request
Enable extensions provide custom terminals to other extensions and tasks
Today extensions and tasks use vscode's API vscode.window.createTerminal(terminalOptions)
to create a new terminal window, and some other APIs to render task output as terminal output.
Our extension can change the way a terminal is started, and we want user to be able to apply this change to other terminals and tasks vscode may be running without changing their code.
The idea is to introduce a concept of Terminal Provider, an object that will be chained when something starts a new terminal:
interface TerminalProvider {
createTerminal(options: TerminalOptions, provider: TerminalProvider): Promise<Terminal>;
}
// A way to register a terminal provider. This function returns a disposable
// which, when disposed, unregisters the provider.
window.registerTerminalProvider(provider: TerminalProvider): Disposable;
When a provider is registered, it will be called when anyone calls window.createTerminal(...)
. The provider
argument in createTerminal
is the previous chained provider, or internal vscode implementation that actually creates a terminal.
Registering or un-registering a provider should not affect existing terminals.