-
Notifications
You must be signed in to change notification settings - Fork 30.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add 'Focus to terminal X' action #20862
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, just a minor comment 👍
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be 1 to 9, not 0 to 9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep thanks
@@ -147,7 +147,7 @@ configurationRegistry.registerConfiguration({ | |||
CreateNewTerminalAction.ID, | |||
CopyTerminalSelectionAction.ID, | |||
KillTerminalAction.ID, | |||
FocusTerminalAction.ID, | |||
FocusActiveTerminalAction.ID, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if all the new commands should be added here as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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