Hello, tech enthusiasts! If you’ve been playing around with tmux for a while, you might already be impressed by its power and versatility. But did you know you could further harness its potential by creating nested sessions? Yeah, you heard it right. You can create tmux sessions within tmux sessions! In this blog, I’m going to walk you through the process of creating a nested tmux session and delve into why it might be useful. So, buckle up and get ready for a deep dive into the world of tmux.
Just starting out with Tmux? Don’t miss out on the Tmux basics. Seasoned with Tmux? Let’s take the plunge!
You can create a new tmux session by using the tmux new
command when you are outside of tmux environment. But, in case you are already in a tmux session and want to create a new session from within, it can be done seamlessly by using the below ways-
Create a nested tmux session
Creating a new tmux session from within another tmux session is easy, you just have to run the following command-
Prefix
:new
By default the prefix is Ctrl-B
, so you can create a nested tmux session using-
Ctrl-B
:new
Create a nested tmux session with a name
Creating a new tmux session from within another tmux session is easy, you just have to run the following command-
Prefix
:new -s <name>
By default the prefix is Ctrl-B
, so you can create a nested tmux session using-
Ctrl-B
:new -s <name>
For example, if you want to name your new session myaws
, your keyboard shortcut and command will look like-
Ctrl-B
:new -s myaws
You can quit a tmux session and then create a new tmux session as well, this will also help you create a tmux session.
We’ve come a long way, haven’t we? From the basic concept of a tmux session to creating nested sessions within it, you’ve now got a grip on the amazing flexibility tmux provides. Remember, nested sessions are a great way to organize your work, but they can also become complex quite fast. The key is to find the balance that works for you. Keep experimenting and keep exploring. That’s the true spirit of the tech world, isn’t it? Stay tuned for more such intriguing explorations into tmux and beyond.
You can also check out the complete tmux cheatsheet of keyboard shortcuts and mouse shortcuts.