# Linux – Interactive search of tmux sessions

bsdcommand linecommand-line-toollinuxtmux

When switching between tmux sessions with the interactive session menu (<prefix>-s), you can jump to a specific session by typing the session's numeric or alphabetical index, e.g.

(0) + first_session: 1 windows (1) + second_session: 2 windows (2) + third_session: 1 windows (3) + secret_session: 1 windows

Pressing 1 will open up the second_session session.

I often have >20 tmux sessions open and I'd like to have a way to search without looking at the whole list. Is there a way to change the behaviour to have an interactive search? That is, I would like to type sec and have the list narrow to

(1) + second_session: 2 windows (3) + secret_session: 1 windows

I've googled quite a bit and found nothing; is this behaviour possible?

bind C-j split-window -v "tmux list-sessions | sed -E 's/:.*$//' | grep -v \"^$(tmux display-message -p '#S')\\$\" | fzf --reverse | xargs tmux switch-client -t"