terminal icon indicating copy to clipboard operation
terminal copied to clipboard

Switch between multiple tabs with CTRL + PGUP/PGDOWN

Open zetric opened this issue 5 years ago • 3 comments

Description of the new feature/enhancement

I can add the following to my config to allow switching tabs with CTRL+PGUP/PGDOWN

{ "command": "nextTab", "keys": "ctrl+pagedown" },
{ "command": "prevTab", "keys": "ctrl+pageup" }

If I e. g. press CTRL+PGDOWN and release CTRL, this works fine for one tab. But If I want to switch between multiple tabs like e. g. in webbrowsers, this does not work as expected. If I keep CTRL pressed and press e. g. PGDOWN a second time, the focus changes to the last tab in the list instead of the next one. The same applies for the other direction with CTRL+PGUP.

In the attached video, you see the following sequences: CTRL+PGDOWN+PGDOWN CTRL+PGUP+PGUP

https://user-images.githubusercontent.com/39863610/107854617-483d0e80-6e1d-11eb-9643-fa09547892c2.mp4

It would be fine if I could switch tabs in Windows Terminal like I am used from other applications.

zetric avatar Feb 13 '21 16:02 zetric

You're keybindings work perfectly here. Here's several PGDNs while holding Ctrl. With PGUP, they go in the other order. I have

Microsoft Windows 10 Pro for Workstations
10.0.19042.804 (2009, 20H2)
WindowsTerminalPreview_1.6.10412.0_x64

https://user-images.githubusercontent.com/61856645/107860108-816c8300-6e0b-11eb-8690-080350e5ddcd.mp4

vefatica avatar Feb 13 '21 19:02 vefatica

@zetric, I finally figured out what was going on in your video. It seems you have TabSwitcher turned on. If you want your key bindings to switch tabs as in a browser (i.e., without showing the tab switcher window), you can use either or both (I believe) of these at the top level in your settings. I think they will then work as you desire.

    "tabSwitcherMode": "disabled",
    "useTabSwitcher": false

vefatica avatar Feb 14 '21 03:02 vefatica

✅@vefatica That was it! Thank you for your very quick analysis and solution!

    "tabSwitcherMode": "disabled",
    "useTabSwitcher": false

This makes sense. The TabSwitcher shows a list. And if you press the PG keys, the behavior is like expected in such lists: It goes one "page" up/down. Without the switcher, it works as desired. Perfect! Again an optimization of the workflow for me as keyboard enthusiast.

Have a great day!

zetric avatar Feb 14 '21 06:02 zetric