Get split terminals working

This commit is contained in:
Daniel Imms
2021-05-26 11:34:11 -07:00
parent 3ff91e7621
commit bf5f7dd5ec
6 changed files with 46 additions and 17 deletions

View File

@@ -49,6 +49,7 @@ export interface IExtHostTerminalService extends ExtHostTerminalServiceShape, ID
export interface ITerminalInternalOptions {
isFeatureTerminal?: boolean;
useShellEnvironment?: boolean;
isSplitTerminal?: boolean;
}
export const IExtHostTerminalService = createDecorator<IExtHostTerminalService>('IExtHostTerminalService');
@@ -130,12 +131,13 @@ export class ExtHostTerminal {
hideFromUser?: boolean,
isFeatureTerminal?: boolean,
isExtensionOwnedTerminal?: boolean,
useShellEnvironment?: boolean
useShellEnvironment?: boolean,
isSplitTerminal?: boolean
): Promise<void> {
if (typeof this._id !== 'string') {
throw new Error('Terminal has already been created');
}
await this._proxy.$createTerminal(this._id, { name: this._name, shellPath, shellArgs, cwd, env, icon, initialText, waitOnExit, strictEnv, hideFromUser, isFeatureTerminal, isExtensionOwnedTerminal, useShellEnvironment });
await this._proxy.$createTerminal(this._id, { name: this._name, shellPath, shellArgs, cwd, env, icon, initialText, waitOnExit, strictEnv, hideFromUser, isFeatureTerminal, isExtensionOwnedTerminal, useShellEnvironment, isSplitTerminal });
}
public async createExtensionTerminal(iconPath?: URI | { light: URI; dark: URI } | ThemeIcon): Promise<number> {
@@ -586,6 +588,22 @@ export abstract class BaseExtHostTerminalService extends Disposable implements I
});
}
public async $createContributedProfileTerminal(id: string): Promise<void> {
// TODO: Use cancellation token
const options = await this._profileProviders.get(id)?.provideProfileOptions(new CancellationTokenSource().token);
if (!options) {
throw new Error(`No terminal profile options provided for id "${id}"`);
}
if ('pty' in options) {
// TODO: Pass in split terminal option
this.createExtensionTerminal(options);
}
// if (options.iconPath) {
// checkProposedApiEnabled(extension);
// }
this.createTerminalFromOptions(options, { isSplitTerminal: true });
}
public async $provideLinks(terminalId: number, line: string): Promise<ITerminalLinkDto[]> {
const terminal = this._getTerminalById(terminalId);
if (!terminal) {