Switching to tmux windows numbered 10 and above

I try my best to not horde browser tabs. Occasionally I look up and realize that I have so many open that I now have to scroll. While I attempt to do the same with my tmux windows (and GNU screen too), there are days where I keep opening news ones, well past the 0-9 range.

Cycle through tmux windows

When this happens, switching with Ctrl+b 0-9 stops being a thing. This makes getting back to these higher numbered windows a bit of a chore.

First, you could use Ctrl+b n to move to the next window in tmux. It gets the job done. But, it can be tedious if you’re trying to say go from window 1 to window 20. You could always jump to window 9 and start from there.

Jump to a specific tmux window

Another method would be to use Ctrl+b ' (single quote), which will prompt you for the index of the window. You can use this method to jump to any window, by its index, not just the windows numbered 10+.

Both of these method are sufficient enough if you aren’t working with many windows numbered 10+. If you’re like me, you try to avoid those higher numbered windows. This methods ends up being more than enough to get back to a window so you can then close it.

Browse tmux windows

Let’s say you’re a maniac that can actually keep more than 10 windows open and straight in your head. There’s a better way to navigate between those higher numbered windows.

Using Ctrl+b w will open up a list of your open windows, and you can cycle through them with a preview and pick which one you’d like to jump to:

I use something similar to navigate between my tmux sessions. While it does work, it’s a bit more work than just being able to use Ctrl+b 0-9, which is precisely why I like to keep my open tmux windows below 10 at all times.

Josh Sherman - The Man, The Myth, The Avatar

About Josh

Husband. Father. Pug dad. Musician. Founder of Holiday API, Head of Engineering and Emoji Specialist at Mailshake, and author of the best damn Lorem Ipsum Library for PHP.

If you found this article helpful, please consider buying me a coffee.