I'm new to tmux and would like to configure it such that when I run tmux
, my customized windows/panes are immediately accessible.
For example, here's a basic ~/.tmux.conf:
new -s main -n workspace
neww
When I run tmux, I get dumped into a plain old session. When I do a list-sessions
, I can see the workspace session specified in the conf file, but in order to use it, I have to switch to it.
How can I just go ahead and make the "workspace" session the session I'm dumped into when I open tmux so that I don't have to switch to it every time?
To create multiple windows, you need at least one tmux session running. You can simply type CTRL + b, let go of both keys and type 'c'. This will open up a new terminal. At the bottom, you can see that there are now multiple windows (0, 1, 2) in the session.
For example, to create a new window the hard way, you can press Ctrl+B followed by : to enter the tmux command line. Type new-window and press Enter to create a new window. This does exactly the same thing as pressing Ctrl+B then C.
To enter command mode, type prefix>: followed by list-sessions or ls to view a list of currently active Tmux sessions. By default, list-sessions are bound to the prefix> s key combination. With j and k, you may explore the session list and activate one by hitting enter.
Not sure I understood the question, but I use tmuxinator to quickly launch sessions pre-populated with windows, panes and processes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With