DEV Community

Cover image for A tmux plugin to make creating/switching sessions easier
Ahmed Kamal
Ahmed Kamal

Posted on

A tmux plugin to make creating/switching sessions easier

Tmux session wizard

tmux-session-wizard

One prefix key to rule them all (with fzf & zoxide):

  • Creating a new session from a list of recently accessed directories
  • Naming a session after a folder/project
  • Switching sessions
  • Viewing current or creating new sessions in one popup

Elevator Pitch

Tmux is powerful, yes, but why is creating/switching sessions (arguably its main feature) is so damn hard to do? To create a new session for a project you have to run tmux new-session -s <session-name> -c <project-folder>. What if you're inside tmux? Oh, wait you have to use -d followed by tmux switch-client -t <session-name>. Oh, wait again! What if you're outside tmux and you want to attach to an existing session? now you have to run tmux attach -t <session-name> instead. What if you can't remember whether you have a session for that project or not. Guess what? Now you have to run tmux has-session -t <session-name>. What if your project folder contains characters not accepted by tmux as a session name? What if you want to show a list of existing sessions? You run tmux list-sessions. What if you want to create a session for a project you've recently navigated to? What if, what if, what if.... HOW IS THAT BETTER THAN HAVING 20 TERMINAL WINDOWS OPEN?

What if you could use 1 prefix key to do all of this? Read on!

Features

prefix + T (customisable) - displays a pop-up with fzf which displays the existing sessions followed by recently accessed directories (using zoxide). Choose the session or the directory and voila! You're in that session. If the session doesn't exist, it will be created.

Get the plugin

Install from https://github.com/27medkamal/tmux-session-wizard

Top comments (0)