Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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):


select sel in $(tmux ls -F '#S'); do
tmux attach -t "$sel"
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.