DEV Community

0 seconds of 1 minute, 43 secondsVolume 90%
Press shift question mark to access a list of keyboard shortcuts
00:00
00:00
01:43
 
Waylon Walker
Waylon Walker

Posted on • Originally published at waylonwalker.com

3 1

catch yourself before you duplicate session

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

Speedy emails, satisfied customers

Postmark Image

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (2)

Collapse
 
mikolajbuchwald profile image
Mikołaj Buchwald

Hi, I tried to do that, but I keep getting the duplicate session: message, and tmux has-session -t returns empty. Any ideas?

Collapse
 
mikolajbuchwald profile image
Mikołaj Buchwald • Edited

Actually, never mind, I was able to just get into the session with:

tmux attach -t <session_name>
Enter fullscreen mode Exit fullscreen mode

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay