catch yourself before you duplicate session

Waylon Walker - Aug 13 '21 - - Dev Community

I see you there, trying to script out your tmux layouts. Tryig to get each project setup just perfect with a script, but you keep stumbling over yourself with duplicate session error messages

The has-session tmux command is a handy tool to prevent this duplicate session error message when scripting your tmux layouts.

command line

The command is pretty straight forward, you simply ask tmux if the session name
you are looking for exists.


 bash
tmux has-session -t "waylonwalker_com"


Enter fullscreen mode Exit fullscreen mode

Be sure to check out the full YouTube playlist and subscribe if you like it.

tmux playlist on youtub

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .