Back to the cards

Navigate windows

Once you have multiple windows open, you need fast ways to jump between them. tmux gives you three approaches, and you'll end up using all of them depending on the situation.

By sequence — step through windows one at a time:

Ctrl-b n    # Next window
Ctrl-b p    # Previous window

This is great when your target is just one or two windows away. n moves right through the window list, p moves left.

By number — jump directly to a specific window:

Ctrl-b 0    # Go to window 0
Ctrl-b 1    # Go to window 1
Ctrl-b 5    # Go to window 5

This is the fastest way when you know which window you want. The numbers match what's shown in the status bar. For windows numbered 10+, use Ctrl-b ' and type the number.

By last — toggle back and forth:

Ctrl-b l    # Jump to the last active window (that's a lowercase L)

This is like Alt-Tab for tmux — perfect when you're switching between two windows repeatedly.

Try It Now

  1. Inside tmux, create 3 windows: press Ctrl-b c twice (you'll have windows 0, 1, 2)
  2. You're on window 2. Press Ctrl-b 0 to jump to window 0
  3. Press Ctrl-b n to step to window 1
  4. Press Ctrl-b n again to step to window 2
  5. Press Ctrl-b p to go back to window 1
  6. Press Ctrl-b 0, then Ctrl-b l to toggle back to window 1

Watch the status bar as you navigate — the * moves to show your current window.

  • Create window — Open new windows with Ctrl-b c
  • List windows — See all windows in a chooser with Ctrl-b w (great when you have many windows)
  • Last window — Ctrl-b l for quick toggling between two windows
  • Rename window — Give windows names so the status bar is easier to scan
Rate this tip