DEV Community

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

Posted on • Edited on • Originally published at waylonwalker.com

4 1

tmux rename session

So you have been working on your tmux workflow, you've dropped a too many window workflow for scoping work that belongs together into separate sessions, but you cannot remember what session your work is in. If your diligent you have named your window when you created it, but sometimes its intent has changed or your were just plain too lazy at the time for the extra characters needed to name it. Don't worry we can still give that session a descriptive name.

Let's rename some sessions in the terminal.

# rename the current session to me
tmux rename-session me

# rename the me session to scratch
tmux rename-session -t me scratch 
Enter fullscreen mode Exit fullscreen mode

There is a default keybinding that you can use <prefix>+$ to rename the current session in the tmux command line.

bind-key          $ command-prompt -I #S "rename-session '%%'"
Enter fullscreen mode Exit fullscreen mode

I've also had this keybinding kicking around for years, but I rarely use it anymore. You will see why in an upcoming video.

bind -n M-W command-prompt "rename-session '%%'"
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

Also check out this long form post for more about how I use tmux.

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more →

Top comments (1)

Collapse
 
raine profile image
Raine Virta • Edited

I've also had this keybinding kicking around for years, but I rarely use it anymore. You will see why in an upcoming video.

So, why? This doesn't mean anything for someone reading the article a year later :)

edit: Found it, he uses this script to open a project and it renames the session automatically to the name of the directory. github.com/WaylonWalker/devtainer/...

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay