Add 'Focus to terminal X' action#20862
Conversation
Tyriar
left a comment
There was a problem hiding this comment.
Looks great, just a minor comment 👍
| actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(FocusActiveTerminalAction, FocusActiveTerminalAction.ID, FocusActiveTerminalAction.LABEL), 'Terminal: Focus Active Terminal', category); | ||
| actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(FocusNextTerminalAction, FocusNextTerminalAction.ID, FocusNextTerminalAction.LABEL), 'Terminal: Focus Next Terminal', category); | ||
| actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(FocusPreviousTerminalAction, FocusPreviousTerminalAction.ID, FocusPreviousTerminalAction.LABEL), 'Terminal: Focus Previous Terminal', category); | ||
| for (let i = 0; i < 10; i++) { |
There was a problem hiding this comment.
This should be 1 to 9, not 0 to 9
| CopyTerminalSelectionAction.ID, | ||
| KillTerminalAction.ID, | ||
| FocusTerminalAction.ID, | ||
| FocusActiveTerminalAction.ID, |
There was a problem hiding this comment.
I wonder if all the new commands should be added here as well?
There was a problem hiding this comment.
Yes they should, if not the terminal may eat the keystrokes before they reach the vscode keybinding system.
|
@hun1ahpu tests are failing on Travis: https://travis-ci.org/Microsoft/vscode/jobs/203133143#L3225 Maybe make it a regular static function instead of an variable storing an inline function? Also changing it to |
| } | ||
|
|
||
| public static getLabel(n: number): string { | ||
| return nls.localize(`workbench.action.terminal.focusByNumber${n}`, `Focus Terminal ${n}`, n); |
There was a problem hiding this comment.
Almost there 😃 I think this should be:
return nls.localize('workbench.action.terminal.focusByNumber', 'Focus Terminal {0}', n);That way our localization system will understand it.
|
Thanks @hun1ahpu! |
Fixes #20133