Michael Charles Aubrey

https://MichaelCharl.es/Aubrey

Introduction to Tmux

Introduction to Tmux

Michael Charles Aubrey // Mon Oct 23 2023

Recently, I've started using Kitty again, a GPU-accelerated terminal emulator.

One of my frustrations is that on my Mac, the "Layouts" feature in Kitty doesn't work due to some conflict with existing keyboard shortcuts. While I could change the keyboard shortcuts, I've opted for a different solution. I'm relying on an old and reliable technology: Tmux.

Screenshot 2023-10-23 at 22.20.07.png

Since I'm a bit rusty on the basic usage, I've put together this simple guide for myself. I thought it might be useful to others, so I'm sharing it here.

If you haven't installed it yet, you can install it with brew install tmux.

  1. Start a new tmux session: Open your terminal and run tmux.

  2. Split vertically: Within the tmux session, press Ctrl-b followed by %. This splits the window vertically.

  3. Split horizontally: Press Ctrl-b followed by ".

Basic Navigation and Management Commands:

  • Move between panes: Press Ctrl-b followed by arrow keys.
  • Close a pane: Press Ctrl-b followed by x.
  • Detach from session: Press Ctrl-b followed by d.

Best Practices:

  • Name your sessions: Use tmux new -s session-name to make sessions easier to identify later.
  • Reattach to sessions: tmux attach -t session-name is useful when returning to detached sessions.

This article was originally published on Qiita.