Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Suggestion] Quick tab switch by Alt+num #86

Closed
comuslxl opened this issue Apr 23, 2021 · 9 comments
Closed

[Suggestion] Quick tab switch by Alt+num #86

comuslxl opened this issue Apr 23, 2021 · 9 comments

Comments

@comuslxl
Copy link

There seems no shortcut for directly switching to tabN.
If i want to switch tab from the 1st one to the 5th, i have to tap Alt+] for 5 times, which is not handy, Alt+5 is more convinient.

Currently, Alt+num is used to open different menu item.
I think shortcuts for such operations should be changed to other ones, eg alt+V for "View" and alt+M for "Mode", and make Alt+num available for tab switching (just like what xshell/terminus do)

@kingToolbox
Copy link
Owner

kingToolbox commented Apr 23, 2021

Thank you. In the new version 2.1.0_prerelease_2, Ctrl+Shift+0~9 has been added to switch to the nth tab.

[TAB] Supports using Ctrl+Shift+1 to Ctrl+Shift+9 to select the first to ninth tab, and Ctrl+Shift+0 to select the last tab. #82

Because of the particularity of terminal/client, the Ctrl modifier key combination is almost used for remote operation, and the Shift, Alt+Shift, Ctrl+Shift, Alt+Ctrl+Shift modifier key combinations are also occupied a lot. So there are not many combinations of shortcuts that can be used. Alt modifier key is a good and meaningful shortcut prefix, like <Alt+M> is used to operate a series of Mode related operations. <Alt+M><Alt+C> toggles Column Mode, <Alt+M><Alt+H> toggles Hex Mode and so on. It would be a waste if they were only used to trigger the menu items.

But the system determines that the menu item must use the Alt modifier key, and the menu item must also be triggered by a shortcut key, so the assignment <Alt+0~9> becomes a good choice.

But if you really want to use <Alt+0~9> to switch the nth tab, you can do it. Take <Alt+1> as an example, just follow the steps below:

  • Open WindTerm-install-path/terminal/configs/menu.config, search and change "Menu": "Session (&1)" to "Menu": "Session".
  • Open WindTerm-install-path/global/wind.keymaps, search and change "keys": "<Ctrl+Shift+1>" to "keys": "<Alt+1>".

<Alt+0~9> can be modified in the same way. In addition, if you change "Menu": "Session (&1)" to "Menu": "&Session", then you can use <Alt+S> to trigger the Session menu item. But it will no longer trigger the default action Show Command Palette, because the shortcut keys of the main menu items have the highest priority. I think this is not good. After all, <Alt+S> can be used to represent a more meaningful Search action.

@gooker
Copy link

gooker commented Apr 23, 2021

good suggest.

There seems no shortcut for directly switching to tabN.
If i want to switch tab from the 1st one to the 5th, i have to tap Alt+] for 5 times, which is not handy, Alt+5 is more convinient.

I set alt+0~9

Open WindTerm-install-path/terminal/configs/menu.config, search and change "Menu": "Session (&1)" to "Menu": "Session".
Open WindTerm-install-path/global/wind.keymaps, search and change "keys": "<Ctrl+Shift+1>" to "keys": "<Alt+1>".

Unfortunately alt + 0-9 only for tabs in one view.not for all tabs.

But I'm used to Alt+[/] :)

@comuslxl
Copy link
Author

Thank you. In the new version 2.1.0_prerelease_2, Ctrl+Shift+0~9 has been added to switch to the nth tab.
But if you really want to use <Alt+0~9> to switch the nth tab, you can do it. Take <Alt+1> as an example, just follow the steps below:

  • Open WindTerm-install-path/terminal/configs/menu.config, search and change "Menu": "Session (&1)" to "Menu": "Session".
  • Open WindTerm-install-path/global/wind.keymaps, search and change "keys": "<Ctrl+Shift+1>" to "keys": "<Alt+1>".

Thanks. I've tried 2.1.0_prerelease_2, shortcut for switching tab is already supportted and can be modified as you mentioned. GREAT!

@kingToolbox
Copy link
Owner

I am glad that the problem has been resolved. Welcome to continue submitting new issues and feature requests. Thank you!

@dehiker
Copy link

dehiker commented Dec 24, 2021

Hi, @kingToolbox, could you give some example on how to set the config in wind.keymaps? I could not find something like "Ctrl+Shift+1" in WindTerm_2.2.2_Windows_Portable.zip. Thx!

@msg7086
Copy link

msg7086 commented Mar 4, 2022

  • Open WindTerm-install-path/terminal/configs/menu.config, search and change "Menu": "Session (&1)" to "Menu": "Session".
  • Open WindTerm-install-path/global/wind.keymaps, search and change "keys": "<Ctrl+Shift+1>" to "keys": "<Alt+1>".

Would love to see this being automated as a toggle switch in the preference dialog.

@kingToolbox
Copy link
Owner

kingToolbox commented Mar 21, 2022

After redesigning the menu bar, WindTerm_2.4.0_Prerelease_1 finally support Alt+0~5 shortcut keys to activate tabs by default. Please download and use it, thank you.

Now the new shortcut keys:

Key Action
Alt+0 Activate the last tab
Alt+1 Activate the first tab
Alt+2 Activate the second tab
Alt+3 Activate the third tab
Alt+4 Activate the fourth tab
Alt+5 Activate the fifth tab
Alt+[ Activate the previous tab
Alt+] Activate the next tab

And shortcut keys such as Ctrl+Alt+0~9 have been removed.

@dehiker
Sorry for late reply, I must have missed your comment. WindTerm has a powerful keyboard customization feature, and each key is customizable, you can read this comment to learn more.

The user interface for customizing shortcut keys will be provided in subsequent versions, please stay tuned, thank you.

@emoxam
Copy link

emoxam commented Dec 28, 2024

Hello! Can i change
Alt+[ Activate the previous tab
Alt+] Activate the next tab
to
ctrl+tab and ctrl+shift+tab accordingly ?

@emoxam
Copy link

emoxam commented Dec 28, 2024

in WindTerm_2.6.1/global/wind.keymaps

{ "keys": "<Ctrl+Shift+Tab",
"modes": "remote",
"action": "Window.ActivatePreviousView"

  { "keys": "<Ctrl+Tab>",
"modes": "remote",
"action": "Window.ActivateNextView"

},

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants