Switching between tmux session efficiently
In a nutshell, I’ve created ~/.local/bin/tmux-fzf-session
and give it
execution permissions (sudo chmod +x ~/.local/bin/tmux-fzf-session
), with the
following content:
|
|
Then, In my tmux.conf
, I’ve added the following to create the tmux shortcut:
|
|
tmux-fzf-session explained
First of all we need to list all ours tmux sessions which can be done with this command:
tmux list-sessions -F "#{session_name}" 2>/dev/null
Second, We pipe the output to fzf
:
fzf --exit-0 --preview='tmux capture-pane -ep -t {}'
Third, the session preview is getting by:
tmux capture-pane -ep -t {}
Done!