Search code examples
tmux

Start tmux in choose-tree mode


When starting tmux, if I want to choose a session but am not sure which one, it would be really handy to launch tmux in the choose-tree mode, so that once I chose a session, it didn't leave a detached and empty one behind.

I found this asked on another site, and it has an answer. But, the person who answered it deleted their account which took their answer with it. I can see a comment to their (now empty) answer which said it involves a ;.

My strong hope is from a bash script, being able to run exec tmux (some arguments) to get this to work. I've already written a tmux starter script, and would like to add this to it.


Solution

  • Apparently there's a website called removeddit.com that can show deleted comments/threads from Reddit.

    Turns out this works:

    tmux attach\; choose-tree
    

    Or, for my specific case:

    exec tmux attach\; choose-tree
    

    There might be a better way, but this seems to work.

    Escaping the ; prevents bash from processing it, allowing tmux to use it.