Skip to content

Instantly share code, notes, and snippets.

@MohamedAlaa
Last active June 17, 2026 08:13
Show Gist options
  • Select an option

  • Save MohamedAlaa/2961058 to your computer and use it in GitHub Desktop.

Select an option

Save MohamedAlaa/2961058 to your computer and use it in GitHub Desktop.
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname

attach:

tmux a  #  (or at, or attach)

attach to named:

tmux a -t myname

list sessions:

tmux ls

kill session:

tmux kill-session -t myname

Kill all the tmux sessions:

tmux ls | grep : | cut -d. -f1 | awk '{print substr($1, 0, length($1)-1)}' | xargs kill

In tmux, hit the prefix ctrl+b (my modified prefix is ctrl+a) and then:

List all shortcuts

to see all the shortcuts keys in tmux simply use the bind-key ? in my case that would be CTRL-B ?

Sessions

:new<CR>  new session
s  list sessions
$  name session

Windows (tabs)

c  create window
w  list windows
n  next window
p  previous window
f  find window
,  name window
&  kill window

Panes (splits)

%  vertical split
"  horizontal split

o  swap panes
q  show pane numbers
x  kill pane
+  break pane into window (e.g. to select text by mouse to copy)
-  restore pane from window
⍽  space - toggle between layouts
<prefix> q (Show pane numbers, when the numbers show up type the key to goto that pane)
<prefix> { (Move the current pane left)
<prefix> } (Move the current pane right)
<prefix> z toggle pane zoom

Sync Panes

You can do this by switching to the appropriate window, typing your Tmux prefix (commonly Ctrl-B or Ctrl-A) and then a colon to bring up a Tmux command line, and typing:

:setw synchronize-panes

You can optionally add on or off to specify which state you want; otherwise the option is simply toggled. This option is specific to one window, so it won’t change the way your other sessions or windows operate. When you’re done, toggle it off again by repeating the command. tip source

Resizing Panes

You can also resize panes if you don’t like the layout defaults. I personally rarely need to do this, though it’s handy to know how. Here is the basic syntax to resize panes:

PREFIX : resize-pane -D (Resizes the current pane down)
PREFIX : resize-pane -U (Resizes the current pane upward)
PREFIX : resize-pane -L (Resizes the current pane left)
PREFIX : resize-pane -R (Resizes the current pane right)
PREFIX : resize-pane -D 20 (Resizes the current pane down by 20 cells)
PREFIX : resize-pane -U 20 (Resizes the current pane upward by 20 cells)
PREFIX : resize-pane -L 20 (Resizes the current pane left by 20 cells)
PREFIX : resize-pane -R 20 (Resizes the current pane right by 20 cells)
PREFIX : resize-pane -t 2 -L 20 (Resizes the pane with the id of 2 left by 20 cells)

Copy mode:

Pressing PREFIX [ places us in Copy mode. We can then use our movement keys to move our cursor around the screen. By default, the arrow keys work. we set our configuration file to use Vim keys for moving between windows and resizing panes so we wouldn’t have to take our hands off the home row. tmux has a vi mode for working with the buffer as well. To enable it, add this line to .tmux.conf:

setw -g mode-keys vi

With this option set, we can use h, j, k, and l to move around our buffer.

To get out of Copy mode, we just press the ENTER key. Moving around one character at a time isn’t very efficient. Since we enabled vi mode, we can also use some other visible shortcuts to move around the buffer.

For example, we can use "w" to jump to the next word and "b" to jump back one word. And we can use "f", followed by any character, to jump to that character on the same line, and "F" to jump backwards on the line.

   Function                vi             emacs
   Back to indentation     ^              M-m
   Clear selection         Escape         C-g
   Copy selection          Enter          M-w
   Cursor down             j              Down
   Cursor left             h              Left
   Cursor right            l              Right
   Cursor to bottom line   L
   Cursor to middle line   M              M-r
   Cursor to top line      H              M-R
   Cursor up               k              Up
   Delete entire line      d              C-u
   Delete to end of line   D              C-k
   End of line             $              C-e
   Goto line               :              g
   Half page down          C-d            M-Down
   Half page up            C-u            M-Up
   Next page               C-f            Page down
   Next word               w              M-f
   Paste buffer            p              C-y
   Previous page           C-b            Page up
   Previous word           b              M-b
   Quit mode               q              Escape
   Scroll down             C-Down or J    C-Down
   Scroll up               C-Up or K      C-Up
   Search again            n              n
   Search backward         ?              C-r
   Search forward          /              C-s
   Start of line           0              C-a
   Start selection         Space          C-Space
   Transpose chars                        C-t

Misc

d  detach
t  big clock
?  list shortcuts
:  prompt

Configurations Options:

# Mouse support - set to on if you want to use the mouse
* setw -g mode-mouse off
* set -g mouse-select-pane off
* set -g mouse-resize-pane off
* set -g mouse-select-window off

# Set the default terminal mode to 256color mode
set -g default-terminal "screen-256color"

# enable activity alerts
setw -g monitor-activity on
set -g visual-activity on

# Center the window list
set -g status-justify centre

# Maximize and restore a pane
unbind Up bind Up new-window -d -n tmp \; swap-pane -s tmp.1 \; select-window -t tmp
unbind Down
bind Down last-window \; swap-pane -s tmp.1 \; kill-window -t tmp

Resources:

Notes:

Changelog:

Request an Update:

We Noticed that our Cheatsheet is growing and people are coloberating to add new tips and tricks, so please tweet to me what would you like to add and let's make it better!

@witerth

witerth commented May 16, 2026

Copy link
Copy Markdown

This tmux cheatsheet is still one of those references that is worth bookmarking. The sections on copy mode, pane resizing, and synchronize-panes are especially useful when jumping between projects or keeping notes open in one pane while testing commands in another. I like having small, quick-reference pages like this for work, and I use the same idea for lighter daily routines too, like checking NYT crossword clues when I need a short puzzle break.

@jasonlee78903

Copy link
Copy Markdown

setting it up for vi mode sounds like a huge quality-of-life upgrade; i've been fighting the default movement keys forever. Might check out some image manipulation stuff next time and see how Image To Image AI handles that kind of detailed control.

@zhaobingkun

Copy link
Copy Markdown

Tracking current and past Wuthering Waves banners here:
https://wuwabanners.net/

@MusicByte

MusicByte commented May 21, 2026

Copy link
Copy Markdown

I've been using tmux for a while now, and it's completely transformed my workflow. The ability to manage multiple terminal sessions seamlessly has saved me so much time. One thing I've been looking for is a simple way to create custom status indicators for my tmux setup. Have you considered adding a feature to display images or custom graphics within tmux? It would be awesome to see something like a personalized avatar in the status bar. Speaking of avatars, I recently found this fantastic tool at squarepfp.com, which lets you create adorable, customizable square profile picture avatars. It's been a fun way to add some personality to my projects. Thanks for sharing these tmux shortcuts and cheatsheet!

@eyeandroid

Copy link
Copy Markdown

This tmux cheatsheet is an absolute lifesaver for terminal workflows. Mastering these core shortcuts ensures you SURVIVE MIN production crises easily. A mandatory bookmark for every efficient developer out there!

@eyeandroid

Copy link
Copy Markdown

@Microhx

Microhx commented May 22, 2026

Copy link
Copy Markdown

I love using tmux for managing multiple terminals. It's so efficient! By the way, if you ever need a quick brain break, check out toon tone —it's a fun color memory game that sharpens your eye for detail.

@kidattheback

Copy link
Copy Markdown

THE Kid at THE BACK starts with something smaller and far more uncomfortable: you notice the quiet boy sitting at the back of the classroom.
Thank you, this is my repo: https://github.com/kidattheback

@zhaobingkun

Copy link
Copy Markdown

Helping homeowners build greener lawns with less water 🌱

DroughtTolerantGrassSeed.com shares practical guides on drought-resistant grass, low-water lawn care, and sustainable landscaping for hot and dry climates.

https://droughttolerantgrassseed.com/

@code-code-cmyk

Copy link
Copy Markdown

This cheatsheet is a fantastic resource for anyone diving into tmux. https://mp3-to-text.org

@YunxiJiang

Copy link
Copy Markdown

Really useful tmux cheatsheet — especially the panes, copy mode, and synchronize-panes sections. I like how it keeps the commands short and easy to scan when setting up a terminal workflow. I was also collecting small developer-friendly tools and notes here: flagtone

@makeqiang321-cell

Copy link
Copy Markdown

★★★★★ ...SURVIVE MIN...

★★★★★ ...Her Trees

★★★★★ ...Lacey's Flash Games

@makeqiang321-cell

Copy link
Copy Markdown

★★★★★ The survive min game that turned one dark room into the most talked-about SURVIVE MIN visual novel of the year.

★★★★★ No tutorial. No hints. Just you, a room full of strange objects, and the quiet satisfaction of figuring it out yourself. — Her Trees

★★★★★ The collection that turned four corrupted 2000s minigames into the most talked-about psychological horror experience of the year. Four games. One missing developer. A story none of them will tell you directly. — Lacey's Flash Games

@zhaobingkun

Copy link
Copy Markdown

I've been comparing real voice recordings with AI-generated ones over the past few weeks.
Honestly, some of them are nearly impossible to distinguish without looking more closely at the audio patterns.
I put together a small tool while experimenting with this:
https://voiceaichecker.com/
Would be interested to know how often people can correctly guess whether a clip is human or AI.

@thefalsesun

Copy link
Copy Markdown

The False Sun starts with a place that should feel safe. You are on your grandfather’s farm, the day is bright, the grass is soft, and somebody familiar is waiting like he has been part of your life for years.
Thank you, this is my repo:https://github.com/thefalsesun

@yangmin12

Copy link
Copy Markdown

This cheatsheet saved me when I was building my first fan site (the freak circus quiz). I'd never used tmux before — just needed to keep my dev server, terminal, and file watcher running at the same time without 10 terminal tabs. The pane shortcuts section is what I keep coming back to. Still use Ctrl+B % and Ctrl+B " every day. Thanks for putting this together — it's been bookmarked since day one.

@harlanc

harlanc commented Jun 9, 2026

Copy link
Copy Markdown

Another Square face generator which is a browser-based, Picrew-style avatar maker focused on charming square-shaped faces. Choose from 12 categories and 200+ customizable parts, including skin tones, bangs, side hair, eyes, nose, mouth, brows, lashes, blush, glasses, hats and outfits, to assemble millions of unique combinations. Everything renders locally in your browser, so nothing leaves your device. It is responsive, touch-friendly, and works equally well on desktop, tablet and phone.

@minecraftapk928-star

Copy link
Copy Markdown

Get the latest Minecraft APK download for free and enjoy endless adventures in the world of Minecraft. Build, explore, and create on your Android device with a secure and fast APK download. Start your Minecraft journey today!

@steelrosellc

Copy link
Copy Markdown

Great cheatsheet! I've been using tmux for a while and it's super handy. By the way, if you're into horror games, you should check out the freak circus—it's terrifying and perfect for a spooky session!

@bellastarc

Copy link
Copy Markdown

We provide reliable and accurate Electrical Estimating Services to support contractors, builders, and developers in planning and budgeting their projects effectively. Our services include detailed electrical material takeoffs, labor cost estimation, and complete project cost analysis. Using industry-standard software and up-to-date pricing, we deliver precise estimates that help reduce project risks, improve bid accuracy, and increase profitability. Our Electrical Estimating Services are designed to save time, control costs, and ensure successful project execution.

@rushcorporation37-afk

Copy link
Copy Markdown

Construction Takeoff Services provide accurate material quantity calculations and detailed project analysis to help contractors, builders, and developers prepare reliable cost estimates. These services involve reviewing blueprints, drawings, and specifications to determine the exact quantities of materials needed for a construction project. Professional takeoff solutions help reduce errors, control costs, improve bidding accuracy, and save valuable time. Whether for residential, commercial, or industrial projects, Construction Takeoff Services ensure better planning, efficient resource management, and a stronger foundation for successful project completion.

@asmrcob-eng

Copy link
Copy Markdown

Discover how Construction Estimating Services Texas help contractors and builders achieve accurate cost planning, better budgeting, and successful project management. Learn why professional estimating solutions are essential for reducing risks, improving bidding accuracy, and controlling construction expenses.

@wyong32

wyong32 commented Jun 12, 2026 via email

Copy link
Copy Markdown

@aryastarc

Copy link
Copy Markdown

Construction Estimating Services NYC provide accurate cost estimates and material takeoffs for residential, commercial, and industrial projects. Our experts help contractors improve bid accuracy, control budgets, reduce risks, and maximize profitability throughout New York City construction projects.

@eixom

eixom commented Jun 15, 2026

Copy link
Copy Markdown

Still one of the most practical tmux references on GitHub. I end up coming back to this gist every few months. These days my workflow is mostly tmux + Neovim + kepo.ai, and this cheat sheet remains a great quick reference. Thanks for sharing.

@Enivel

Enivel commented Jun 15, 2026 via email

Copy link
Copy Markdown

@chaoditang

Copy link
Copy Markdown

Great read! For anyone who enjoys number puzzles but wants something a bit less serious, the Meowdoku Game Guide breaks down the cat-themed logic in a surprisingly clear way. The walkthroughs make tricky levels feel manageable, and the app links are a nice bonus. Definitely worth a bookmark if you are tired of standard sudoku grids.

@chaoditang

Copy link
Copy Markdown

Great read! For anyone who enjoys number puzzles but wants something a bit less serious, the Meowdoku Game Guidebreaks down the cat-themed logic in a surprisingly clear way. The walkthroughs make tricky levels feel manageable, and the app links are a nice bonus. Definitely worth a bookmark if you are tired of standard sudoku grids.

@Construction09

Copy link
Copy Markdown

[Construction Estimating Services NYC] offers reliable cost estimates and detailed material takeoffs for residential, commercial, and industrial construction projects. Our experienced estimators help contractors prepare more accurate bids, stay within budget, minimize project risks, and increase profitability. We provide the insights and support needed to keep construction projects across New York City running smoothly and efficiently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment