Several active tmux windows can hold similar shells, editors, log views, and monitors inside one session. Select the target window before typing so input reaches the intended workspace without detaching, changing sessions, or rearranging panes.

tmux tracks windows by a session-local index and an optional name. The default Ctrl+b then w binding opens the interactive tree, Ctrl+b followed by a number jumps to a numbered window, and select-window targets a window directly from a shell or from the tmux command prompt.

Window names do not have to be unique, so a target such as work:1 is safer than a name when automation or detached commands need an exact window. The command examples were verified with tmux 3.6 on Ubuntu 26.04; use the configured prefix instead of Ctrl+b when the session has a custom prefix.

Steps to select a tmux window:

  1. List the windows in the target session before choosing one.
    $ tmux list-windows -t work
    0: shell* (1 panes) [80x24] [layout b25d,80x24,0,0,0] @0 (active)
    1: logs (1 panes) [80x24] [layout b25e,80x24,0,0,1] @1
    2: monitor (1 panes) [80x24] [layout b25f,80x24,0,0,2] @2

    The number before each colon is the window index, and the asterisk marks the current window for that session.

  2. Open the interactive tree from an attached tmux client when the window list is easier to scan visually.
    Ctrl+b w

    Move with the arrow keys, expand sessions with the right arrow when needed, and press Enter to select the highlighted window.

  3. Switch directly to a numbered window when the target index is known.
    Ctrl+b 1

    Replace 1 with the target window number. The default number bindings cover 0 through 9.

  4. Move to the next or previous window when the target is adjacent.
    Ctrl+b n
    Ctrl+b p

    Ctrl+b n runs next-window, and Ctrl+b p runs previous-window.

  5. Return to the previously selected window after checking another one.
    Ctrl+b l

    The default l binding runs last-window, which toggles back to the last current window in the session.

  6. Select a known window from a normal shell when a script or detached check needs an explicit target.
    $ tmux select-window -t work:1

    The target format is session:window. In this example, work:1 means window 1 in the work session.

  7. Confirm the selected window from a shell after switching.
    $ tmux list-windows -t work
    0: shell- (1 panes) [80x24] [layout b25d,80x24,0,0,0] @0
    1: logs* (1 panes) [80x24] [layout b25e,80x24,0,0,1] @1 (active)
    2: monitor (1 panes) [80x24] [layout b25f,80x24,0,0,2] @2

    The asterisk moved from shell to logs, and logs is now marked active for the work session.

  8. Select by window name only when the name is unique enough for the current session.
    $ tmux select-window -t work:monitor

    Use the numeric target instead when more than one window could match the same name.