Gerard Condon's Blog

Journal of a software developer.


What is tmux

  • tmux is a terminal multiplexer.
  • can launch multiple terminals from a single environment - effectively new terminal tabs
  • can divide the window into panes
  • can detach from a session and keep it running in the background

Basic usage

  • PREFIX - this is the tmux prefix. By default this is ctrl-b but you can remap this to an easier key

Outside tmux

  • tmux new -s session_name - create a new session with the given session name
    • pass the -d flag to create this session in the background
  • tmux ls - list the running sessions
    • if there are no running sessions then you will see this error failed to connect to server: Connection refused
  • tmux attach - if there is only one session running then attach to it
  • tmux attach -t session_name - attach to a specified session
  • tmux kill-session -t session_name - kill the session specifed by the session name

Inside tmux

  • PREFIX d - detach from a session

  • exit - exits tmux and kills session



Tmux & VIM