Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I jump to double-digit window number in tmux?

Tags:

tmux

Normally, I can jump to a window in tmux using Prefix-N, where N is my window number.

Unfortunately, if N is number of like 10, it will just jump to window 1.

How can I jump to Window 10 instead?

like image 990
merlin2011 Avatar asked Aug 15 '14 23:08

merlin2011


People also ask

How do I change my window number tmux?

The swap-window command is closest to what you want. to let window number 3 and window number 1 swap their positions. (if base-index is 0, as it is by default). Command move-window -t <NUMBER> is by default bound to Ctrl + B , . .

How do I navigate a tmux window?

prefix+w. By default, tmux comes with a tmux choose-tree command bound to prefix+w , which opens in full screen. The upper section of the screen will show every window opened.

What is Ctrl B in tmux?

ctrl-b, <arrow key> switch to the pane in whichever direction you press. ctrl-b, d. detach from tmux, leaving everything running in the background.


1 Answers

There are two straightforward options (let C-b represent the prefix key):

  1. Bring up a prompt in which to enter a specific window index with C-b ' (this is a default key binding). Press enter after inputting the desired index.
  2. Interactively select the window you want from a list with C-b w (also a default key binding). In this list, windows are assigned a character in order from 0 to 9 and then from a onward. Press a character to jump to the corresponding window or use the arrow keys to highlight one and press enter.

Although option 2 is fewer keystrokes (using the characters), it's arguably less elegant than option 1. First, the window list completely obscures the current pane; second, indices are assigned to windows based on their order, meaning that the index in the list may sometimes differ from the index displayed in the window titles (such as when there are gaps in the window numbering).

If you're looking for the least intrusive and most analogous (compared to C-b N) solution, option 1 is probably your best bet.

like image 71
nklauza Avatar answered Sep 28 '22 05:09

nklauza