Hacker News new | ask | show | jobs
by hugodan 60 days ago
I would love to have a way to switch sessions easily, like with panes where I just click or have more shortcuts available
6 comments

Here’s a simple session switcher: `bind C-a display-popup -E "tmux list-sessions -F '#{session_name}' | fzf --reverse | xargs tmux switch-client -t"`. No plugins, nothing fancy, just works.
i just have a little script called session (invoked as session namespace name and mapping to a tmux session called namespace/name and searching all namespaces if the namespace is elided) that just does the right tmux invocation for the various intersecting cases of [in or not in a tmux session already, target session does or does not exist] which also has the side benefit of leaving shell history breadcrumbs i can follow between sessions later if needed
People have developed plugins for this. Check out “sesh” for instance.

Switching between sessions with fuzzy finding, and creating new ones when needed, is a wonderful feature.

I use byobu for managing tmux windows and sessions https://www.byobu.org/
Check out the `choose-tree` and `display-menu` commands.
Prefix-w works, or did you want something more?