dcmbrown
dcmbrown

Reputation: 1109

iTerm tab switching order

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?

Upvotes: 85

Views: 11204

Answers (3)

Alexei Tenitski
Alexei Tenitski

Reputation: 9370

Go to Preferences -> Keys -> Key Bindings.

The default mappings for ^Tab / ^⇧Tab are Cycle Tabs Forward / Cycle Tabs Backward.

Change those to Next Tab / Previous Tab (or any other actions you prefer).

Screenshot of iTerm2 with Next/Previous Tab key bindings.

Upvotes: 137

Infustion
Infustion

Reputation: 51

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.

Upvotes: 1

Pierre Olivier Tran
Pierre Olivier Tran

Reputation: 1875

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.

Upvotes: 1

Related Questions