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.
| Key | Default | Notes |
|---|---|---|
selection-clear-on-typing | true | since 1.2.0, any keypress that reaches the program clears it |
selection-clear-on-copy | false | clears after copy_to_clipboard, but not after copy-on-select |
selection-foreground / selection-background | auto | #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-protection | true | warn 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.
| Argument | Effect |
|---|---|
left, right | one cell |
up, down | one line |
page_up, page_down | one page |
home, end | top-left or bottom-right of the screen |
beginning_of_line, end_of_line | line 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
| Key | Default | Notes |
|---|---|---|
mouse-hide-while-typing | false | reappears on any mouse use |
mouse-shift-capture | — | whether programs can see shift+click |
mouse-reporting | true | false blocks reporting no matter what the program asks |
mouse-scroll-multiplier | 3 discrete, 1 precision | clamped to 0.01–10000 |
right-click-action | context-menu | context-menu, paste, copy, copy-or-paste, ignore |
click-repeat-interval | platform default | ms between clicks to count as a double or triple click |
focus-follows-mouse | — | focus the split under the pointer |
cursor-click-to-move | false | click 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.
Links
link-url = true # default link-previews = true # true, false, or osc8, since 1.2.0
URLs are matched on hover with ctrl held on Linux or cmd on macOS, and open in
the system default application. link-previews = osc8 shows the preview only for
OSC 8 hyperlinks, where the visible text can differ from the destination, which is
exactly the case where a preview matters.
The built-in URL matcher is always the lowest priority. The link option exists for
custom regex-to-action matching, and its own documentation notes it cannot currently
be set, so treat link-url as the switch you have.
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.