2

I'm trying to build a wrapper for tmux that presents me with a menu of all available sessions instead of creating a new one. However the man page explicitly says that this is not possible (excerpt from the choose-tree command):

This command works only if at least one client is attached.

How could I have a shell function / script to present me with the the menu above, but without goint into tmux first? Or maybe a shortcut to attach and show the chooser in one go?

1 Answer 1

5

Probably easiest is to create your own menu and then attach selected session. Something like following (replace select with dialog, zenity or whatever other menu):

#!/bin/bash    

select sel in $(tmux ls -F '#S'); do
    break;
done
tmux attach -t "$sel"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .