Ghostty Cheatsheet

Mouse and Selection

Use this Ghostty reference while you build software engineering projects, review code, or refresh the syntax you reach for most.

Copy on select

copy-on-select = true        # default on macOS and Linux
copy-on-select = clipboard   # selection clipboard AND system clipboard
copy-on-select = false

true prefers the selection clipboard where one exists. clipboard writes to both. Middle-click paste always reads the selection clipboard and stays enabled even when copy-on-select = false.

KeyDefaultNotes
selection-clear-on-typingtruesince 1.2.0, any keypress that reaches the program clears it
selection-clear-on-copyfalseclears after copy_to_clipboard, but not after copy-on-select
selection-foreground / selection-backgroundauto#RRGGBB or an X11 color name
clipboard-read / clipboard-write—control OSC 52 access
clipboard-trim-trailing-spaces—strip trailing whitespace on copy
clipboard-paste-protectiontruewarn before pasting unsafe content

With selection-clear-on-typing = false, a single click or escape still clears the selection manually.

Word boundaries

Double-click selects a word, and selection-word-chars defines where a word stops. It lists the boundary characters, the inverse of zsh's WORDCHARS.

selection-word-chars = " \t'\"│`|:,()[]{}<>$"

The default is ` \t'"│|:;,()[]{}<>$ ` (a leading space, then a tab). Each character in the string is one boundary. Multi-byte UTF-8 works, but only single codepoints, so emoji sequences are not supported. U+0000` is always a boundary and does not need listing. Available since 1.3.0.

Selection keybinds

adjust_selection extends an existing selection relative to the cursor. It does not create one, so it does nothing when nothing is selected.

ArgumentEffect
left, rightone cell
up, downone line
page_up, page_downone page
home, endtop-left or bottom-right of the screen
beginning_of_line, end_of_lineline edges

The defaults on both platforms bind shift+arrow, shift+page_up, shift+page_down, shift+home, and shift+end to these, all performable: so the key falls through when there is no selection.

keybind = shift+left=adjust_selection:left
keybind = cmd+a=select_all
keybind = cmd+e=search_selection
keybind = cmd+j=scroll_to_selection

Related actions: select_all, copy_to_clipboard, paste_from_clipboard, paste_from_selection, copy_url_to_clipboard, copy_title_to_clipboard, write_selection_file.

Mouse behavior

KeyDefaultNotes
mouse-hide-while-typingfalsereappears on any mouse use
mouse-shift-capture—whether programs can see shift+click
mouse-reportingtruefalse blocks reporting no matter what the program asks
mouse-scroll-multiplier3 discrete, 1 precisionclamped to 0.01–10000
right-click-actioncontext-menucontext-menu, paste, copy, copy-or-paste, ignore
click-repeat-intervalplatform defaultms between clicks to count as a double or triple click
focus-follows-mouse—focus the split under the pointer
cursor-click-to-movefalseclick in the prompt to move the cursor
mouse-hide-while-typing = true
mouse-scroll-multiplier = precision:0.1,discrete:3
right-click-action = copy-or-paste

The precision: and discrete: prefixes were added in 1.2.1, and can be combined in one comma-separated value. Without a prefix the multiplier applies to every scroll device. toggle_mouse_reporting flips mouse-reporting at runtime, which is the fastest way out of a TUI that has hijacked your mouse. On macOS, click-repeat-interval defaults to the OS setting, elsewhere it is 500ms.

cursor-click-to-move needs prompt marking via OSC 133. Fish 4 and Nu 0.111+ provide it natively, other shells need Ghostty's shell integration. Depending on the shell it works by synthesizing arrow keys or by sending a click event, so edge cases can behave oddly.

Selection needs shell integration

Selecting a full command's output with ctrl+triple-click (Linux) or cmd+triple-click (macOS), moving the cursor with alt+click at a prompt, and jump_to_prompt all depend on shell integration being active. Without it, triple click still selects a line and jump_to_prompt does nothing.