10 Actually Useful tmux Shortcuts (2026)
In this tutorial, you'll learn about 10 actually useful tmux shortcuts (2026). We cover key concepts, practical examples, and best practices to help you understand and apply this topic effectively.
Most tmux tutorials cover Ctrl-b % (split vertically), Ctrl-b " (split horizontally), and Ctrl-b arrow (switch panes). Those are table stakes. This list covers the shortcuts that actually save you time in daily terminal work — the ones you reach for when you have three panes, two windows, and a growing sense of chaos. These are the shortcuts that experienced users reach for instinctively.
In this guide, you will learn 10 tmux shortcuts that go beyond basic split and switch operations. These shortcuts solve real problems: managing multiple panes efficiently, naming sessions and windows for clarity, navigating complex layouts without counting arrow key presses, and recovering from mistakes. Each shortcut is presented with the exact keystrokes and a concrete scenario where it helps. Practice each one in isolation before combining them in a real workflow.
Why tmux Changes Your Terminal Workflow
Tmux solves three problems that every terminal user encounters. First, it keeps processes running when you disconnect from a remote server — start a build, close your laptop, reconnect later, and the build is still running. Second, it manages multiple terminal sessions within a single window, replacing the need for multiple terminal tabs or windows. Third, it provides a persistent environment that survives network interruptions, which is essential for remote work on unstable connections.
The learning curve for tmux is real but front-loaded. The keybinding system (prefix key + command key) feels awkward for the first few hours. After the initial investment, the shortcuts become automatic and you stop thinking about them — you just zoom panes, switch windows, and navigate layouts by instinct. The payoff is measured in the elimination of dozens of small frustrations per day: no more lost work from closed terminals, no more hunting for the right window, no more rebuilding layouts after reconnect.
This guide focuses on the shortcuts that matter most in daily use. If you learn only three, learn Prefix z (zoom), Prefix q (pane numbers), and Prefix w (window tree). These three cover the most common sources of friction in daily tmux use and each one eliminates a specific annoyance that users typically work around. These three cover 80% of the navigation overhead in a multi-pane, multi-window session. The remaining seven shortcuts fill in edge cases and advanced workflows that experienced users reach for daily.
Before You Start: Understanding the Prefix Key
All tmux shortcuts start with a prefix key, which is Ctrl-b by default. You press the prefix, release both keys, then press the command key. For example, to zoom a pane: press Ctrl-b, release, then press z. The prefix is configurable in ~/.tmux.conf — many users rebind to Ctrl-a (like GNU Screen) or Caps Lock for easier reach.
The default prefix Ctrl-b is chosen because it does not conflict with common shell and editor shortcuts. Ctrl-a is used by bash for moving to the beginning of the line, so rebinding the prefix to Ctrl-a requires also configuring a way to send Ctrl-a to the shell (typically by pressing the prefix twice). Evaluate the trade-off between ease of reaching the prefix key versus breaking existing shell muscle memory.
Throughout this guide, shortcuts are written as Prefix <key> where Prefix means Ctrl-b (or your configured prefix). The first step in learning tmux is making the prefix key automatic — once your fingers know it, everything else follows naturally.
Learning Path for New tmux Users
If you are new to tmux, follow this progression. Day one: learn to create a session (tmux new -s name), split panes (Prefix % and Prefix "), switch panes with arrow keys, and detach/reattach (Prefix d, then tmux attach). These four operations get you productive immediately.
Day two: add Prefix z (zoom) and Prefix q (pane numbers). These solve the two most common annoyances — cramped panes and slow pane switching. Practice them until they are automatic.
Day three: add Prefix , (rename window) and Prefix w (window tree). These organize your workflow and let you navigate multiple windows without counting keystrokes.
Day four and beyond: add the remaining shortcuts as you encounter situations where they help. Do not try to learn all ten at once — the ones you do not practice will not stick.
The Shortcuts
Prefix z (Zoom pane) — Toggles the current pane to full-screen and back. When you need to read a long error message, edit a file without squinting, or scroll through logs, zoom the pane instead of resizing everything. One toggle in, one toggle out. No layout destruction.
Prefix z is the highest-impact shortcut on this list. In a typical tmux session, you might have a code editor on the left and a terminal on the right. When the terminal output is long (a test run, a build log, or a stack trace), the pane is too narrow to read without horizontal scrolling. Press Prefix z, and the terminal pane expands to fill the entire window. Read what you need, press Prefix z again, and the layout restores to its original split positions.
The zoom state is visually indicated in the status bar — the zoomed pane's window name is highlighted or marked with a symbol. While zoomed, all other panes are hidden but their processes continue running. This is important: a long-running build in an unzoomed pane does not pause when you zoom another pane. You can also zoom a pane, switch to another window, and come back — the pane remains zoomed until you unzoom it.
Zoom is also useful for copy mode. When you enter tmux copy mode (Prefix [) to scroll through history, the zoomed view gives you the full window width for reading. After finding the line you need, unzoom and continue working. The toggle nature of this shortcut (same key to enter and exit zoom) makes it easy to develop muscle memory without remembering separate enable/disable keys.
In automated workflows, zoom is useful when running commands that produce wide output. If you have a script that runs a test suite and you want to see the output full-width, you can zoom the test runner pane before starting the tests. The zoom state is persistent across pane activity — a build that completes in a zoomed pane stays zoomed, showing the final output at full width.
Prefix q (Show pane numbers) — Displays large numeric overlays on every pane for 2 seconds. Type the number to jump directly to that pane. Indispensable when you have 4+ panes and arrow-key navigation becomes tedious.
When you have more than two or three panes, navigating with Prefix left/right/up/down arrows becomes slow because you must reason about which pane is in each direction. Prefix q solves this by displaying a large number in the center of each pane for two seconds. Type the number of the target pane while the numbers are visible, and tmux jumps the cursor to that pane immediately.
The pane numbering follows creation order by default. The first pane created in a window is pane 0, the second split is pane 1, and so on. The numbers are assigned at pane creation time and do not change unless you rearrange panes. This means the numbers are predictable — if you always create the editor first and the terminal second, the editor is always pane 0 and the terminal is pane 1.
The display-panes command (which Prefix q triggers) also accepts an optional duration argument. If two seconds is too short or too long, run Prefix : display-panes -t 5000 to set the display duration to 5000 milliseconds (5 seconds). You can bind this to a custom key if you frequently need longer display times.
Prefix q is especially useful for scripts or one-liners that target a specific pane by number. The send-keys -t target-pane tmux command sends keystrokes to a specific pane, and Prefix q shows you the numbers to use. This is useful for automation within tmux sessions where you need to send commands to a specific pane from a script.
# Add to ~/.tmux.conf for visual zoom indicator
set -g window-status-current-format ' #I #W #{?window_zoomed_flag, Z, } '
Prefix q (Show pane numbers) — Displays large numeric overlays on every pane for 2 seconds. Type the number to jump directly to that pane. Indispensable when you have 4+ panes and arrow-key navigation becomes tedious.
When you have more than two or three panes, navigating with Prefix left/right/up/down arrows becomes slow because you must reason about which direction to press. Prefix q solves this by displaying a large number in the center of each pane for two seconds. Type the number of the target pane while the numbers are visible, and tmux jumps the cursor to that pane immediately.
The pane numbering follows creation order by default. The first pane created in a window is pane 0, the second split is pane 1, and so on. The numbers are assigned at pane creation time and do not change unless you rearrange panes. This means the numbers are predictable — if you always create the editor first and the terminal second, the editor is always pane 0.
Prefix q is especially useful for scripts or one-liners that target a specific pane by number. The send-keys -t target-pane tmux command sends keystrokes to a specific pane, and the display-panes command (which Prefix q triggers) shows you the numbers to use. This is useful for automation within tmux sessions.
# Show pane numbers and wait for input
# Prefix q (then type number)
# Send a command to a specific pane from another pane
# tmux send-keys -t 1 'npm run build' Enter
Prefix { and Prefix } (Swap panes) — Moves the current pane left ({) or right (}). When you split a pane in the wrong order, swap instead of closing and re-splitting. Especially useful when pairing — move your pane to the left side without rebuilding the layout.
Pane swapping reorders existing panes without destroying and recreating them. Press Prefix { to move the current pane one position to the left (or up in vertical layouts). Press Prefix } to move it one position to the right (or down). The swap exchanges the position of the current pane with its neighbor in the specified direction.
This is most useful when you have created panes in the wrong order. For example, you might want the editor on the left and the terminal on the right, but you created the terminal first and it occupies the left position. Instead of closing the terminal pane and re-splitting, simply focus the terminal pane, press Prefix } to move it right, and the editor pane shifts left automatically.
During pair programming sessions, swap panes to position your pane on the side you prefer. If the person sharing the terminal prefers the left side and you prefer the right, you can both sit comfortably without one person having to reach across the screen. The swap operation is instant and does not interrupt running processes in either pane.
# Move current pane left
# Prefix {
# Move current pane right
# Prefix }
# These commands work regardless of the current layout
# direction — they follow the natural layout order.
Prefix ! (Break pane to window) — Pops the current pane out into its own full-size window. When a pane becomes more important than its siblings (a long-running build, a tailed log), break it out for focused attention. The inverse is Prefix : join-pane to reattach it.
Prefix ! detaches the current pane from its current window and creates a new window containing only that pane. The new window gets a default name (usually the program running in the pane). The original window continues with the remaining panes in their existing layout. This is useful when one pane needs more attention than the others.
The classic scenario: you have a three-pane window with an editor, a test runner, and a development server. The test runner starts executing a long test suite that produces important output. Break the test runner pane into its own window (Prefix !), watch the test output in full screen, and switch back to the editor window (Prefix 0 or Prefix w) to continue working while the tests run in the background.
To rejoin the broken-out pane back into the original window, use the join-pane command: switch to the broken-out window, then run Prefix : join-pane -s <window-name> from the target window. This attaches the pane from the specified window into the current window as an additional pane.
# Break current pane to new window
# Prefix !
# Join pane from window 1 back to current window
# Prefix :join-pane -s 1
# Join pane from specific source window and target index
# Prefix :join-pane -s 1 -t 0
Prefix , (Rename window) — Gives the current window a meaningful name. After 8 windows named "bash", you will not remember which is the dev server, which is the database shell, and which is SSHed into production. Name them as you create them.
Window naming is the single most impactful organization habit in tmux. By default, tmux names windows after the currently running process (usually "bash" or "zsh"). When you have multiple windows, they all show the same name, making the window list in the status bar useless for navigation. Press Prefix , to enter a custom name for the current window.
The naming convention matters. Use descriptive names like "editor", "server", "logs", "db-shell", "prod-ssh". The status bar shows the active window highlighted and inactive windows dimmed. With named windows, you can glance at the status bar and immediately know what each window contains. This eliminates the need to cycle through windows looking for the right one.
Window names persist for the session duration. When you rename a window and later run a different process in it, the custom name stays until you explicitly change it back. This means a window named "server" stays named "server" even if the server process exits and you are back at the shell prompt. Rename after completing a task to prepare the window for the next use.
# Rename current window
# Prefix , "# Then type the new name and press Enter
# Rename from command line for scripting
# tmux rename-window -t 1 "server-logs]
# Rename all windows in the current session
# for i in $(tmux list-windows -F '#{window_index}'); do
# tmux rename-window -t $i "window-$i"
# done
Prefix w (Window tree) — Opens an interactive tree view of all windows across all sessions. Navigate with arrow keys and press Enter to jump. When you have multiple sessions (project work", server monitoring, ad-hoc commands), this is your session dashboard.
Prefix w displays an interactive list of all tmux sessions, with each session's windows indented beneath it. Navigate up and down with arrow keys, expand and collapse sessions, and press Enter on a window to jump directly to it. The tree view includes the window name, current process, and the number of panes in each window.
This is the primary navigation tool for multi-session workflows. If you have one session for a web development project with five windows, another session for server monitoring with three windows, and a third session for ad-hoc commands, Prefix w shows everything in one place. You can jump from the ad-hoc session to a specific window in the project session without remembering session and window numbers.
The window tree also shows the active window in each session with an asterisk. This tells you which windows have recent activity without switching to each session. The tree view respects the status bar styling from your tmux configuration, so colors and formatting carry through.
# Open window tree
# Prefix w
# Navigation: Arrow keys to move, Enter to select
# q to close without switching
Prefix & (Kill pane) — Kills the current pane or window with a confirmation prompt. Cleaner than exit (which can accidentally close the whole session if you are in the last pane). The confirmation saves you from muscle-memory disasters.
Prefix & prompts for confirmation before killing the current pane. Type y to confirm or any other key to cancel. This extra step prevents accidents when you intended to close a pane but fat-fingered the shortcut. The confirmation is especially valuable when working in a window with a single pane — killing that pane destroys the window entirely.
The difference between Prefix & and typing exit in the shell is subtle but important. exit closes the shell process, which causes tmux to close the pane as a side effect. If the shell process is a child of some other process, exit may not work correctly. Prefix & sends the SIGTERM signal directly to the process, bypassing the shell entirely.
For killing a pane without confirmation, use Prefix x (the kill-pane command also prompts). To disable the confirmation prompt entirely, bind an alias in ~/.tmux.conf: bind X kill-pane. Capital X (using the bind command) avoids overriding the built-in x binding that asks for confirmation.
# Kill current pane with confirmation
# Prefix &
# Type y to confirm, any other key to cancel
# Kill pane without confirmation (custom binding)
# bind X kill-pane
# Kill a specific pane by index
# tmux kill-pane -t 1
Prefix s (Session list) — Shows all tmux sessions with previews. Switch, create, or kill sessions from this interactive menu. When you SSH into a server and find five detached sessions from last week, this is how you sort them out.
Prefix s opens an interactive session browser similar to the window tree but at the session level. The list shows each session name, the number of windows, the current window name, and the session creation time. Navigate with arrow keys and press Enter to switch to the selected session.
From the session list, you can also create new sessions (press c), rename sessions (r), and kill sessions (x with confirmation). This makes it a session management dashboard rather than just a switcher. The session list is the first thing to check when you reconnect to a remote server and find orphaned sessions from previous work sessions.
Session naming is as important as window naming. Use tmux new -s project-name when creating sessions. The session name appears in the status bar and in the session list, making it easy to identify which session belongs to which project. Detached sessions that have been idle for weeks can be killed from the session list without attaching to each one.
Prefix : (Command prompt) — Opens a tmux command line where you can run any tmux command: set -g mouse on, resize-pane -D 10, setw -g mode-keys vi. This is the escape hatch for everything not bound to a key. Learn list-keys here.
Prefix : opens a command prompt at the bottom of the screen where you can type any tmux command. This is the tmux equivalent of Vim's command mode. It provides access to every tmux feature, including those without default keybindings. The command prompt supports tab completion for command names and option flags.
The most useful commands to type here include set -g mouse on to enable mouse support for the current session, setw -g mode-keys vi to switch copy mode to vi-style keybindings (h/j/k/l for movement), resize-pane -D 10 to resize the current pane 10 lines downward, swap-pane -U to move the current pane up, and list-keys to display every keybinding in a pager.
The list-keys command is essential for learning tmux. It shows every bound key with its tmux command, including bindings from plugins and your custom ~/.tmux.conf. Pipe through grep to find specific commands: Prefix : list-keys | grep resize. Use this to discover what keys do what without leaving tmux.
The command prompt also supports sourcing configuration fragments. If you want to test a setting without editing ~/.tmux.conf, type it at the command prompt. If it works, add it to the config file permanently. For example, set -g status-bg blue changes the status bar background for the current session only.
Prefix ? (Keybindings) — Shows every keybinding in a searchable pager. When you forget a shortcut, don't Google it — this lists every binding, including ones from plugins. Press / to search by function.
Prefix ? opens a pager (tmux's copy mode) displaying the complete list of keybindings grouped by prefix and key. Each line shows the key combination and the tmux command it invokes. The pager supports scrolling with arrow keys, searching with / (then n for next match), and exiting with q.
Use this as your primary reference when learning new shortcuts. Instead of reaching for your phone to search "tmux resize pane shortcut," press Prefix ?, search for "resize" with /, and find the binding immediately. The keybinding list includes your custom bindings from ~/.tmux.conf, so it always reflects your actual configuration.
The keybinding display format shows the exact key you need to press. For example, bind-key -T prefix % split-window -h means "in the prefix key table, % splits the window horizontally." The -T prefix part means the key is pressed after the prefix. Commands without -T prefix are global bindings that work without the prefix.
The keybinding list also shows bindings from the prefix table versus the root table. Root table bindings work without the prefix key (like Ctrl-l for clear screen). The help output distinguishes these clearly, so you can discover both prefix-dependent and prefix-independent shortcuts in one place.
Session naming is as important as window naming. Use tmux new -s project-name when creating sessions. The session name appears in the status bar and in the session list, making it easy to identify which session belongs to which project. Detached sessions that have been idle for weeks can be killed from the session list without attaching to each one.
# Open session list
# Prefix s
# From session list:
# Enter: Switch to selected session
# c: Create new session
# r: Rename selected session
# x: Kill selected session (with confirmation)
# Create named session from command line
# tmux new-session -s my-project
Prefix : (Command prompt) — Opens a tmux command line where you can run any tmux command: set -g mouse on, resize-pane -D 10, setw -g mode-keys vi. This is the escape hatch for everything not bound to a key. Learn list-keys here.
Prefix : opens a command prompt at the bottom of the screen where you can type any tmux command. This is the tmux equivalent of Vim's command mode. It provides access to every tmux feature, including those without default keybindings. The command prompt supports tab completion for command names and option flags.
The most useful commands to type here include set -g mouse on to enable mouse support for the current session, setw -g mode-keys vi to switch copy mode to vi-style keybindings (h/j/k/l for movement), resize-pane -D 10 to resize the current pane 10 lines downward, swap-pane -U to move the current pane up, and list-keys to display every keybinding in a pager.
The list-keys command is essential for learning tmux. It shows every bound key with its tmux command, including bindings from plugins and your custom ~/.tmux.conf. Pipe through grep to find specific commands: Prefix : list-keys | grep resize. Use this to discover what keys do what without leaving tmux.
# Open command prompt
# Prefix :
# Common commands to type:
# set -g mouse on
# setw -g mode-keys vi
# resize-pane -D 10
# resize-pane -R 20
# swap-pane -U
# list-keys
# list-keys | grep -i window
Prefix ? (Keybindings) — Shows every keybinding in a searchable pager. When you forget a shortcut, don't Google it — this lists every binding, including ones from plugins. Press / to search by function.
Prefix ? opens a pager (tmux's copy mode) displaying the complete list of keybindings grouped by prefix and key. Each line shows the key combination and the tmux command it invokes. The pager supports scrolling with arrow keys, searching with / (then n for next match), and exiting with q.
Use this as your primary reference when learning new shortcuts. Instead of reaching for your phone to search "tmux resize pane shortcut," press Prefix ?, search for "resize" with /, and find the binding immediately. The keybinding list includes your custom bindings from ~/.tmux.conf, so it always reflects your actual configuration.
The keybinding display format shows the exact key you need to press. For example, bind-key -T prefix % split-window -h means "in the prefix key table, % splits the window horizontally." The -T prefix part means the key is pressed after the prefix. Commands without -T prefix are global bindings that work without the prefix.
# Show all keybindings
# Prefix ?
# Navigate:
# arrow keys / PgUp / PgDn: Scroll
# / : Search
# n : Next search match
# q : Close
Troubleshooting Common tmux Issues
Lost session after terminal close: If you close a terminal window without detaching from tmux, the session continues running in the background. Reopen a terminal and run tmux attach to reconnect. If you have multiple sessions, use tmux attach -t <session-name> to attach to a specific one. If you forgot to name the session, run tmux ls to list all available sessions.
Prefix key not responding: Verify that you are pressing the prefix keys sequentially (not simultaneously). Press and release Ctrl, press and release b, then press the command key. If you rebound the prefix in ~/.tmux.conf, ensure the file is loaded by running tmux source-file ~/.tmux.conf. If the prefix was rebound to Ctrl-a, remember that Ctrl-a conflicts with the shell's beginning-of-line shortcut — you may need to press the prefix twice to send a literal Ctrl-a to the shell.
Zoomed pane stuck full-screen: If a pane is zoomed and you cannot remember the unzoom key, press Prefix z again — it is a toggle. If that does not work, check whether you are in a nested tmux session (tmux within tmux). In nested sessions, the outer tmux captures the Prefix z first. Press the outer prefix twice (e.g., Ctrl-b Ctrl-b z) to send the command to the inner tmux.
Copy mode not copying to system clipboard: Tmux's copy mode copies into tmux's internal buffer, not the system clipboard. To send buffered text to the system clipboard, configure set -g set-clipboard on in ~/.tmux.conf and ensure your terminal emulator supports the OSC 52 escape sequence (most modern terminals do). On macOS, pipe through pbcopy: tmux show-buffer | pbcopy.
Customizing the tmux Status Bar
The status bar at the bottom of the screen shows session name, window list, and the current time. Configure its appearance in ~/.tmux.conf. Set the status bar position: set -g status-position top moves it to the top of the screen. Set the status interval: set -g status-interval 5 updates the clock and other dynamic content every 5 seconds instead of the default 15.
Customize the status bar content with format strings. The left side typically shows the session name: set -g status-left '#[fg=green]#S#[default]'. The right side shows the date and hostname: set -g status-right '#[fg=yellow]%Y-%m-%d %H:%M #[fg=cyan]#H'. The window list in the center shows windows with the active window highlighted and alerts marked.
Status bar styling uses attribute and color directives. #[fg=red] sets foreground color, #[bg=blue] sets background, #[bold] and #[dim] control text weight, and #[default] resets to the default colors. The status bar supports UTF-8 characters, so you can use Unicode symbols as separators: set -g status-right '#[fg=white]| #[fg=yellow]%H:%M'.
tmux Configuration File Tips
The ~/.tmux.conf file is read when tmux starts. Changes made while tmux is running require a reload: Prefix : source-file ~/.tmux.conf. Common initial settings include enabling mouse support (set -g mouse on), setting the default terminal to 256 colors (set -g default-terminal "tmux-256color"), and setting the index to start at 1 instead of 0 (set -g base-index 1; setw -g pane-base-index 1).
Configuration changes are best made incrementally. Add one setting at a time, reload, and test before adding the next. This makes it easy to identify which change caused a problem. Back up your working configuration file to a dotfiles Repository so you can restore it on a new machine in seconds.
Practice Questions
- What is the difference between Prefix z (zoom pane) and Prefix ! (break pane to window)?
- How would you rename a window to "server-logs" without using the mouse?
- What should you press when you have 6 panes and want to jump directly to pane 4?
- What is the safest way to kill a pane that might be the last pane in a window?
- How do you find every keybinding related to window operations without leaving tmux?
Answers
- Prefix z toggles the pane to full-screen within the current window without changing the window count. Prefix ! creates a new window containing only that pane, separating it from its siblings. Zoom is temporary and reversible with the same key. Break is structural and requires manual re-joining.
- Press Prefix , (comma), type the new name "server-logs", and press Enter. The status bar updates immediately.
- Press Prefix q to show pane numbers, then press 4 while the overlay is visible (within 2 seconds).
- Use Prefix & which prompts for confirmation (
y/n) before killing the pane. This prevents accidentally killing the last pane in a window, which would destroy the window. - Press Prefix ? to open the keybinding list, then press
/and type "window" to search. Pressnto cycle through matches.
Real-World Task: Remote Debugging Session
You are SSHed into a production server to debug a performance issue. Use tmux throughout the session to maintain continuity even if your connection drops.
- Start a named tmux session:
tmux new -s debug-session. Everything you do is now within tmux. - Split into three panes: top pane for the editor (nvim config files), bottom-left for the log stream, bottom-right for running diagnostic commands.
- Tail the application log in the bottom-left pane. When a relevant log line appears, use Prefix z to zoom that pane and read the full output.
- When you need to research a finding, use Prefix w to create a new window, open a browser or curl command, then switch back to the main window.
- If your SSH connection drops, reconnect and run
tmux attach -t debug-session. Everything is exactly where you left it. - At the end, kill the session with
tmux kill-session -t debug-sessionto clean up.
Challenge: Synchronize Pane Input
Tmux supports synchronizing input across all panes in the current window. Enable it with Prefix : setw synchronize-panes. Every keystroke you type is sent to every pane simultaneously. This is useful for running the same command on multiple servers (SSHed into different panes) or editing the same file across multiple panes.
The challenge: create a three-pane window where each pane SSHs into a different server. Enable synchronized input and run uptime on all three servers simultaneously. Disable sync with the same command when you are done. This workflow is commonly used by SRE teams for running ad-hoc commands across server fleets without Orchestration tools.
- Prefix z toggles the pane to full-screen within the current window without changing the window count. Prefix ! creates a new window containing only that pane, separating it from its siblings. Zoom is temporary and reversible with the same key. Break is structural and requires manual re-joining.
- Press Prefix , (comma), type the new name "server-logs", and press Enter. The status bar updates immediately.
- Press Prefix q to show pane numbers, then press 4 while the overlay is visible (within 2 seconds).
- Use Prefix & which prompts for confirmation (
y/n) before killing the pane. This prevents accidentally killing the last pane in a window, which would destroy the window. - Press Prefix ? to open the keybinding list, then press
/and type "window" to search. Pressnto cycle through matches.
Using tmux Plugins with TPM
The Tmux Plugin Manager (TPM) extends tmux with community-maintained features. Install TPM by cloning the Repository: git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm. Add run '~/.tmux/plugins/tpm/tpm' to the bottom of ~/.tmux.conf. Define plugins in the configuration file using set -g @plugin 'username/plugin-name'. Reload config with Prefix I to install all listed plugins.
Essential plugins include tmux-resurrect (save and restore sessions across reboots), tmux-continuum (auto-save every 15 minutes and restore on startup), tmux-sensible (sensible default settings recommended by the tmux team), tmux-yank (system clipboard integration with copy mode), and tmux-prefix-highlight (shows the prefix key name in the status bar when it is being pressed).
Plugins are installed per-user and do not require root access. Each plugin is a git Repository in ~/.tmux/plugins/. Update all plugins with Prefix U. Remove a plugin by deleting its set -g @plugin line and running Prefix M-u to remove the directory. TPM handles the lifecycle without manual git operations.
Mini Project: Build a Development Workspace
Create a Shell Script that launches a complete development tmux session with named windows for editor, server, logs, and database shell. The script should create a session named after the project, set up the window layout with appropriate pane splits in each window, and start the development server in the server window.
#!/bin/bash
# dev-session.sh — Create a development tmux session
SESSION_NAME="my-project]
tmux new-session -d -s "$SESSION_NAME" -n "editor"
tmux send-keys -t "$SESSION_NAME:editor" "cd ~/projects/my-project && nvim ." Enter
tmux new-window -t "$SESSION_NAME" -n "server"
tmux send-keys -t "$SESSION_NAME:server" "cd ~/projects/my-project && npm run dev" Enter
tmux new-window -t "$SESSION_NAME" -n "logs"
tmux split-window -h -t "$SESSION_NAME:logs"
tmux send-keys -t "$SESSION_NAME:logs.0" "cd ~/projects/my-project && tail -f logs/app.log" Enter
tmux send-keys -t "$SESSION_NAME:logs.1" "cd ~/projects/my-project && npx jest --watch" Enter
tmux new-window -t "$SESSION_NAME" -n "db-shell"
tmux send-keys -t "$SESSION_NAME:db-shell" "psql -d my_project" Enter
tmux select-window -t "$SESSION_NAME:editor"
tmux attach -t "$SESSION_NAME"
Learning tmux is a classic investment curve: a steep upfront cost followed by continuous returns. The ten shortcuts in this guide cover everything you need for daily terminal work. Start with zoom (Prefix z) and pane numbers (Prefix q), then add window renaming and the window tree. Within two weeks, these shortcuts become part of your muscle memory and you will wonder how you managed terminals without them.
Run Prefix q the next time you have more than three panes in a window. The immediate speed improvement will motivate you to learn the rest. The time invested in learning these shortcuts pays back within the first week of regular tmux use.
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro