iTerm tab switching order
Asked Answered
O

3

82

A weird issue that comes up every once in a while when I have a lot of terminal tabs open and am switching between them via the keyboard is that the tabs get out of order. Normally iTerm will activate/focus the next tab to the right or the left, but sometimes I manage to screw this tab focus order up and it will jump over several before switching back to the next proper in the list of tabs.

So when I use the keyboard to switch between tabs using Command-left_arrow or Command-right_arrow and the tabs are out of order they may end up jumping back and forth down the line of tabs. I've yet to figure out how I get them out of this order in the first place.

Is there a way to fix this other than quitting iTerm and restarting? How do I do this in the first place?

Owsley answered 20/8, 2015 at 17:42 Comment(3)
Just to add, I am having the same exact problem - but it occurs when I have as little as 1 terminal open, with only 4 tabs. It is very annoying.Huxley
Not a direct answer to your question, but have you ever considered using tmux? I too had some struggle with iTerms tab and pane management and the shortcuts didnt feel natural and would often times distract me by placing my fingers too far away from the homerow. Ever since i use tmux I feel a lot more productive. I dont use the iTerm-tmux binding, just plain tmux inside a single iTerm window. It also doesnt chain you to OS X and in the long term the muscle memory comes in handy when required to work with different unix machines and/or ssh'ing to unix servers.Seasonseasonable
I switched to tmux for this reason.Huxley
C
132

In Preferences -> Keys -> Key Bindings you can map iTerm tab switching shortcuts to Next Tab / Previous Tab (or any other actions you prefer).

The default is Cycle Tabs Forward / Cycle Tabs Backward.

enter image description here

Catarinacatarrh answered 23/1, 2017 at 3:13 Comment(3)
In Preferences -> Keys: set key combination ^↦ to action "Move Tab Right", likewise set key combination ^⇧↤ to "Move Tab Left"Truffle
cgl, I would suggest to set Next Tab / Previous Tab, rather than Move Tab Right / Move Tab Left, if you want some kind of "normal" behaviour.Legwork
Sanity restored. Whichever developer made the other feature the default was either forcing this behavior onto users when it was perfectly fine as it is, or someone senior panicked and thought a new release needs to advertise new features. There's a reason that when you press the "a" key, "a" appears on your screen. Don't change it please.Aggappe
E
1

I had this weird bug when I was using the same combination as you do (Ctrl + Left / Right Arrow). I'm not quite sure about the expected behaviour of this shortcut, it seems to behave in a "graphic" way (won't select the next/previous tab, but rather the one in the arrow direction). Although I found out that the usual tab-switching command is Cmd + [ or Cmd + ] , this one seems to work just fine.

Epode answered 21/9, 2015 at 9:11 Comment(0)
T
0

I found that when the random behaviour appeared I could systematically click each tab left to right with the mouse and that magically restored the predictable expected behaviour of my Next/Previous-Tab keystroke shortcuts.

Tintinnabulum answered 27/5, 2022 at 3:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.