Show error notification when profile fails

This commit is contained in:
Daniel Imms 2021-06-11 05:15:35 -07:00
parent a742a9bbe8
commit 9677eddbff
2 changed files with 8 additions and 4 deletions

View file

@ -602,7 +602,7 @@ export abstract class BaseExtHostTerminalService extends Disposable implements I
if (token.isCancellationRequested) {
return;
}
if (!profile) {
if (!profile || !('options' in profile)) {
throw new Error(`No terminal profile options provided for id "${id}"`);
}
if ('pty' in profile.options) {

View file

@ -1024,9 +1024,13 @@ export class TerminalService implements ITerminalService {
this._notificationService.error(`No terminal profile provider registered for id "${id}"`);
return;
}
await profileProvider.createContributedTerminalProfile(isSplitTerminal);
this.setActiveInstanceByIndex(this._terminalInstances.length - 1);
await this.getActiveInstance()?.focusWhenReady();
try {
await profileProvider.createContributedTerminalProfile(isSplitTerminal);
this.setActiveInstanceByIndex(this._terminalInstances.length - 1);
await this.getActiveInstance()?.focusWhenReady();
} catch (e) {
this._notificationService.error(e.message);
}
}
private _createProfileQuickPickItem(profile: ITerminalProfile): IProfileQuickPickItem {