Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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

1 Answer 1

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"
share|improve this answer

Your Answer

 
discard

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.