Skip to content

Commit

Permalink
warn user if we try to rename the active terminal when none exists
Browse files Browse the repository at this point in the history
  • Loading branch information
petevdp committed Nov 12, 2019
1 parent 62feea2 commit 231d559
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/vs/workbench/contrib/terminal/browser/terminalActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1082,9 +1082,14 @@ export class RenameActiveTerminalCommand extends Command {
newName: string;
}
): void {
const notificationService = accessor.get(INotificationService);
const terminalInstance = accessor.get(ITerminalService).getActiveInstance();

if (!terminalInstance) {
notificationService.warn(nls.localize(
RenameActiveTerminalCommand.LABEL + '.noActiveTerminal',
'No active terminal to rename'
));
return;
}

Expand Down

0 comments on commit 231d559

Please sign in to comment.