Getting habit to use TMUX

assorted color striped illustration
Photo by Dom J on Pexels.com

Recently been practicing TMUX for my day to day tasks. To be honest, I am late. I should have get used to it earlier. It is much more robust and well sorted than the other terminal multiplexers such as screen. How am I adapting?

Default Session set to TMUX when create a new terminal session

if [ -z "$TMUX" ]; then
    tmux attach -t default || tmux new -s default
fi

I do set this code block to the .bashrc. So that, Whenever I create new window of the terminal or ssh to a server, I get into the default tmux session. Thus no fear of failed operation in case of network error.

Basic Commands

  • tmux new -s playground – Create a tmux session naming playground
  • ctrl+b then d – To detach session
  • tmux ls – list of sessions
  • ctrl+b – To give command to tmux
  • ctrl+b then o – To go to next pane
  • tmux a -t playground – Attach to the session playground
  • ctrl+b then ” – To horizontally split the pane
  • ctrl+b then % – To vertically split the pane
  • ctrl+b then arrow keys – To change pane left, right, up, down
  • ctrl+b then x – To kill session, you can also just use exit
  • ctrl+b then z – Zoom a pane

I will try to update this post once I have time managing more time to write about tmux.