Interactive search of tmux sessions

GerritS

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?

bartj3

Yes it is, but as far as i know you'll need an extra tool for the searching itself. I'm using fzf for the (fuzzy) searching. Once fzf is installed you can use the following config to set up the session switching with search:

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"

I didn't figure this out myself but took this from Chris Toomey's public tmux conf.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Interactive search of tmux sessions and windows with synchronize-panes on

Does "ulimit -Su" limit the number of user processes created in interactive login subshells and tmux sessions created therein?

Fullscreen TMUX sessions selection

How to reorder TMUX sessions?

Switch between sessions in tmux?

Tmux: showing sessions on bottom row

Switch between sessions in tmux by name?

How to save multiple sessions in tmux?

Ending all tmux sessions at once

tmux: variables sharing between sessions

Use multiple byobu sessions, while ignoring unrelated tmux sessions

`tmux ls` does not show all active sessions (sessions in “zombie” state?)

How to kill all tmux sessions (or at least multiple sessions) from the CLI?

tmux set session variable for different sessions

Spinning up multiple tmux sessions in bash

tmux can't find sessions in socket

How to quickly send commands to nested tmux sessions?

tmux died and says "no sessions" - is there any way to recover?

Running tmux sessions inside tilix terminal emulator

Running two tmux sessions as systemd service

How does tmux spawn multiple sessions?

New tmux sessions do not source bashrc file

Changing the location where tmux saves sessions?

Tmux failed to connect to server error on `tmux ls` when there are no running sessions

Interactive less search with wildcards

Interactive search/replace regex in Vim?

how to search within shortcuts of tmux

tmux copy mode search highlight

How to configure kubernetes to allow for long running interactive sessions?

TOP Ranking

HotTag

Archive