{"slug": "tmux-cheat-sheet", "title": "tmux Cheat Sheet", "summary": "The article provides a cheat sheet for using the terminal multiplexer tmux, including commands to start sessions, manage windows and panes, and select text using modifier keys. It also explains how to configure tmux through the `~/.tmux.conf` file, such as changing the default prefix key and enabling mouse support on macOS.", "body_md": "Table of Contents\n-\nStart a tmux session with\ntmux\n-\nSelect text in a tmux window with your mouse by holding the\nSHIFT\nkey (Windows) or theOPTIONS\nkey (Mac) and then using the mouse as you'd normally do\nStart a new tmux session with tmux\nbefore running the script!\n# start a new tmux session and detach from it\ntmux new-session -d -s session1\ntmux rename-window 'my window'\ntmux send-keys 'echo \"pane 1\"' C-m\ntmux select-window -t session1:0\ntmux split-window -h\ntmux send-keys 'echo \"pane 2\"' C-m\ntmux split-window -h\ntmux send-keys 'echo \"pane 3\"' C-m\n# we want to have notifications in the status bar, if there are changes in the windows\ntmux setw -g monitor-activity on\ntmux set -g visual-activity on\ntmux select-layout even-horizontal\n# select the first window to be in the foreground\ntmux select-window -t session:1\n# attach our terminal to the tmux session\ntmux -2 attach-session -t cflogs\nYou can configure tmux via the ~/.tmux.conf\nfile. After making changes to the config file, you can update the configuration \"on-the-fly\" with\ntmux source ~/.tmux.conf\nUse\nset -g prefix C-a\nto change the default prefix from CTRL\n+ b\nto CTRL\n+ a\n. Optionally you can \"free\" the default binding with\nunbind C-b\nYou can add / alter tmux's key bindings with the following command\nbind | split-window -h\nthis binds the split window -h\ncommand to the |\nkey.\nIn order to have mouse support in Mac OS X, you can add the following lines to your config file:\nset -g mode-mouse on\nset -g mouse-resize-pane on\nset -g mouse-select-pane on\nset -g mouse-select-window on", "url": "https://wpnews.pro/news/tmux-cheat-sheet", "canonical_source": "https://gist.github.com/michaellihs/b6d46fa460fa5e429ea7ee5ff8794b96", "published_at": "2016-09-16 08:54:43+00:00", "updated_at": "2026-05-22 18:08:18.943109+00:00", "lang": "en", "topics": ["developer-tools"], "entities": ["tmux", "Mac OS X", "Windows", "Mac"], "alternates": {"html": "https://wpnews.pro/news/tmux-cheat-sheet", "markdown": "https://wpnews.pro/news/tmux-cheat-sheet.md", "text": "https://wpnews.pro/news/tmux-cheat-sheet.txt", "jsonld": "https://wpnews.pro/news/tmux-cheat-sheet.jsonld"}}