How to set up tmux so that it starts up with specified windows opened?
To configure your terminal to automatically start tmux as default, add the following lines to your ~/. bash_profile shell startup file, just above your aliases section. Save the file and close it. Then close and reopen the terminal to start using tmux by default, every time you open a terminal window.
Ctrl+b, let go of Ctrl, Letf / Right / Up / Down will switch active panes.
Using the Prefixes to Control Tmux By default, the prefix is CTRL+B. That is, we have to press the keys CTRL+B and then the command. For example, to create a new session, the command would be C. So, to create a new session we need to press CTRL+B and next C – CTRL+B, C.
ctrl + b + " to make a Horizontal split. ctrl + b + left arrow to move to the left pane. ctrl + b + " to make a Horizontal split.
You can write a small shell script that launches tmux with the required programs. I have the following in a shell script that I call dev-tmux. A dev environment:
#!/bin/sh tmux new-session -d 'vim' tmux split-window -v 'ipython' tmux split-window -h tmux new-window 'mutt' tmux -2 attach-session -d
So everytime I want to launch my favorite dev environment I can just do
$ dev-tmux
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