302 lines
12 KiB
Markdown
302 lines
12 KiB
Markdown
# ghosttyconf user guide
|
|
|
|
This guide covers everything ghosttyconf can do. For a quick overview, see
|
|
the [README](../README.md).
|
|
|
|
- [Which file is edited](#which-file-is-edited)
|
|
- [The screen](#the-screen)
|
|
- [Finding options](#finding-options)
|
|
- [Editing values](#editing-values)
|
|
- [Repeatable options](#repeatable-options)
|
|
- [Themes, fonts and the palette](#themes-fonts-and-the-palette)
|
|
- [Key bindings](#key-bindings)
|
|
- [Saving](#saving)
|
|
- [Reloading Ghostty](#reloading-ghostty)
|
|
- [Troubleshooting](#troubleshooting)
|
|
|
|
## Which file is edited
|
|
|
|
Ghostty reads several config files at startup, one after another, and later
|
|
files override earlier ones:
|
|
|
|
1. `$XDG_CONFIG_HOME/ghostty/config`, then `…/config.ghostty`
|
|
(`$XDG_CONFIG_HOME` defaults to `~/.config`)
|
|
2. on macOS only: `~/Library/Application Support/com.mitchellh.ghostty/config`,
|
|
then `…/config.ghostty`
|
|
|
|
Without an argument, ghosttyconf opens the **last existing file in this list**,
|
|
because that file has the final say. If none exists yet, it creates
|
|
`config.ghostty` in the Application Support folder on macOS, or in
|
|
`~/.config/ghostty` elsewhere. The file is only written when you save.
|
|
|
|
```sh
|
|
ghosttyconf --print-path # show the choice without starting the editor
|
|
ghosttyconf path/to/config # edit another file
|
|
```
|
|
|
|
Files pulled in with `config-file = …` are not opened automatically. To edit
|
|
one, pass its path.
|
|
|
|
## The screen
|
|
|
|

|
|
|
|
| Area | Content |
|
|
| --- | --- |
|
|
| Top line | the edited file, Ghostty's version and the number of options |
|
|
| **Categories** (left) | `Set in Config` (everything in your file), `All Options`, then 19 topics such as Fonts, Window or Key bindings |
|
|
| **Options** (right) | name, current value and a marker for each option |
|
|
| **Documentation** (bottom) | type, default, current value, platform and Ghostty's documentation of the selected option |
|
|
| Status line | unsaved changes, results of saving and reloading |
|
|
|
|
The markers in front of an option name mean:
|
|
|
|
| Marker | Meaning |
|
|
| --- | --- |
|
|
| ● green | set in your config file |
|
|
| ● yellow | changed, not saved yet |
|
|
| ○ yellow | removed, not saved yet |
|
|
| `✗ invalid` (red) | the value in your file is not valid for this option |
|
|
|
|
Keys in your file that Ghostty doesn't know (typos, options of a newer or
|
|
older Ghostty version) appear under **Set in Config** with a red name and an
|
|
explanation. They are kept as they are until you remove them with `r`.
|
|
|
|
`←`/`→` or `tab` switch between the category and option lists. `shift+↑`/`↓`
|
|
(or `ctrl+u`/`ctrl+d`) scroll the documentation. Mouse clicks and the wheel work
|
|
in every list.
|
|
|
|
## Finding options
|
|
|
|
- **Search** with `/` (or `ctrl+f`). It searches all options: name matches
|
|
come first, then matches in the documentation. Several words must all match.
|
|
`enter` or `↓` jumps into the results, and `esc` clears the search.
|
|
- **Platform filter** with `p`. Hides options that only work on the other
|
|
operating system (`macos-*` on Linux, GTK options on macOS).
|
|
- **Set in Config** lists exactly what your file contains, in file order.
|
|
|
|
## Editing values
|
|
|
|
Press `enter` on an option. Booleans don't open an editor, they toggle
|
|
directly. With `space` you can toggle a boolean or step through a choice
|
|
without opening anything, and `+`/`-` change numbers in place.
|
|
|
|
| Option type | Editor | Example |
|
|
| --- | --- | --- |
|
|
| boolean | toggles on `enter`/`space` | `font-thicken` |
|
|
| choice | list of allowed values | `cursor-style`, `macos-titlebar-style` |
|
|
| flags | checklist: `space` toggles, `a` all, `n` none, `d` defaults | `shell-integration-features` |
|
|
| number | text field, `↑`/`↓` step the value | `font-size`, `background-opacity` |
|
|
| metric | number or percentage | `adjust-cell-height` |
|
|
| color | text field with live swatch; hex or X11 names | `cursor-color`, `background` |
|
|
| padding, duration, text, path | text field with format hint | `window-padding-x`, `resize-overlay-duration` |
|
|
| theme | theme picker | `theme` |
|
|
| font | font picker | `font-family` |
|
|
| palette | 256-color table | `palette` |
|
|
| key binding | key binding editor | `keybind` |
|
|
|
|
Text fields check the value while you type (`✓ valid` / `✗ …`). An empty field
|
|
resets the option to its default.
|
|
|
|
**Reset** with `r` or `del` removes the option from your file, so Ghostty's
|
|
default applies again. **Undo** with `u` or `ctrl+z` goes back one change at a
|
|
time. `c` shows a diff of everything not saved yet.
|
|
|
|
## Repeatable options
|
|
|
|
Options that can appear several times, such as `font-family`, `env`,
|
|
`config-file` or `font-feature`, open a list editor:
|
|
|
|
| Key | Action |
|
|
| --- | --- |
|
|
| `a` | add an entry |
|
|
| `enter` / `e` | edit the entry (on a built-in default: copy it into your file first) |
|
|
| `r` | edit the entry as raw text |
|
|
| `d` | delete the entry |
|
|
| `J` / `K` | move the entry down / up |
|
|
| `v` | show or hide Ghostty's built-in defaults |
|
|
| `esc` | done |
|
|
|
|
The order matters for Ghostty (for example, the first `font-family` is the
|
|
primary font), and the list editor keeps it.
|
|
|
|
## Themes, fonts and the palette
|
|
|
|

|
|
|
|
**Themes.** The picker lists all themes from `ghostty +list-themes`, including
|
|
your own in `~/.config/ghostty/themes`. Type to filter, and `tab` completes the
|
|
highlighted name. The preview below the list shows the highlighted theme's
|
|
prompt, file listing, syntax colors and palette. If your config sets colors
|
|
itself (`background`, `cursor-color`, `palette`, …), a note lists them, because
|
|
they take precedence over any theme. You can also type a value the list doesn't
|
|
know, such as `light:Catppuccin Latte,dark:Catppuccin Mocha`.
|
|
|
|
**Fonts.** `font-family`, `font-family-bold` and the other font options offer
|
|
the families from `ghostty +list-fonts`.
|
|
|
|
**Palette.** The palette editor shows all 256 colors. Colors you haven't set
|
|
come from your theme, or from Ghostty's defaults. `enter` edits a color, and
|
|
`d` resets it.
|
|
|
|
## Key bindings
|
|
|
|
Open the key binding editor with `b`, or with `enter` on the `keybind`
|
|
option.
|
|
|
|

|
|
|
|
### What you see
|
|
|
|
The table contains every binding that is in effect: Ghostty's built-in
|
|
bindings with the entries of your file applied on top. The **Source** column
|
|
tells where a binding comes from:
|
|
|
|
| Source | Meaning |
|
|
| --- | --- |
|
|
| `default` | built into Ghostty, untouched |
|
|
| `changed` | a built-in key that you gave a different action |
|
|
| `custom` | a key that only your config binds |
|
|
| `unbound` | a built-in key that you switched off (`…=unbind`) |
|
|
|
|
The panel on the right documents the selected action, including its parameters,
|
|
and lists every key that triggers it.
|
|
|
|
| Key | Action |
|
|
| --- | --- |
|
|
| `enter` | change the selected binding |
|
|
| `a` | add a binding |
|
|
| `d` | unbind: the key no longer does anything in Ghostty |
|
|
| `r` | restore Ghostty's default for this key |
|
|
| `/` | filter by key, action or description |
|
|
| `c` | show only your changes |
|
|
| `s` | sort by action or by key |
|
|
| `R` | edit the raw `keybind` entries in a list editor |
|
|
| `esc` | done |
|
|
|
|
Filtering understands the spellings Ghostty accepts. `cmd+d`, `command+d` and
|
|
`super+d` find the same binding, and an exact key match is listed first.
|
|
|
|
### The binding form
|
|
|
|
The form has two fields, **Trigger** and **Action**. `tab` moves between them.
|
|
|
|
- **Trigger**: a key with modifiers (`super+shift+t`), a sequence
|
|
(`ctrl+a>n`), and optionally a prefix such as `global:`, `all:`,
|
|
`unconsumed:` or `performable:`.
|
|
- **Action**: type to search all actions. `↑`/`↓` choose, and `tab` completes.
|
|
The list shows a short description, and the documentation below explains the
|
|
parameters (`new_split:right`, `resize_split:up,10`, …).
|
|
|
|
While you type, the form warns about unknown keys and actions, and about
|
|
triggers that already do something else. Saving a conflicting trigger replaces
|
|
the other binding.
|
|
|
|
### Recording a shortcut
|
|
|
|

|
|
|
|
Press `ctrl+r` in the form and then the shortcut. Pressing several combinations
|
|
records a sequence. `backspace` removes the last key, `enter` finishes and
|
|
`esc` cancels.
|
|
|
|
While recording, ghosttyconf asks the terminal for the kitty keyboard protocol.
|
|
Ghostty supports it, so it reports `⌘`/super and keys that normally send
|
|
nothing. In terminals without the protocol, a warning says that super
|
|
combinations may not arrive.
|
|
|
|
Shortcuts that Ghostty or macOS handle themselves never reach the program, so
|
|
they can't be recorded. This includes any shortcut Ghostty currently has
|
|
bound, such as `super+t` for a new tab. Type those into the field instead.
|
|
|
|
### What ends up in the file
|
|
|
|
The editor keeps your file minimal and readable:
|
|
|
|
- Changing an entry of your own rewrites that line in place.
|
|
- Moving a built-in binding to another key unbinds the old key and adds the
|
|
new one:
|
|
|
|
```ini
|
|
keybind = super+d=unbind
|
|
keybind = super+\=new_split:right
|
|
```
|
|
|
|
- A binding you set back to Ghostty's default is removed from the file.
|
|
- `keybind = clear` (removes all built-in bindings), `chain=` entries and
|
|
prefixes are understood and preserved.
|
|
|
|
## Saving
|
|
|
|
`ctrl+s` saves. Quitting with unsaved changes asks whether to save, discard
|
|
or go back.
|
|
|
|
1. **Validation.** The new config is written to a temporary file and checked
|
|
with `ghostty +validate-config`. Problems are listed with their messages,
|
|
and you can go back to editing or save anyway. Ghostty itself ignores
|
|
invalid lines and uses the defaults for them.
|
|
2. **Changes on disk.** If the file was modified by another program after
|
|
ghosttyconf loaded it, you are asked before overwriting it.
|
|
3. **Backup.** The first save of every session copies the previous file to
|
|
`<config>.bak` next to it.
|
|
4. **Atomic write.** The file is replaced through a temporary file in the same
|
|
directory, so it is always either the old or the new version. If the config
|
|
is a symlink (for example into a dotfiles repository), the target is
|
|
written and the link stays. File permissions are kept.
|
|
|
|
Everything you didn't touch stays exactly as it was: comments, blank lines,
|
|
the order of lines and their formatting. A changed value is rewritten on its
|
|
own line. New entries of a repeatable option go after its existing ones, and
|
|
new options go after the last entry in the file, so trailing comments stay at
|
|
the end.
|
|
|
|
## Reloading Ghostty
|
|
|
|
After a successful save, ghosttyconf asks the running Ghostty to reload its
|
|
configuration, the same as `⌘⇧,` on macOS or `ctrl+shift+,` on Linux. The
|
|
status line reports the result.
|
|
|
|
**macOS.** The reload uses Ghostty's AppleScript support:
|
|
|
|
```applescript
|
|
tell application id "com.mitchellh.ghostty" to perform action "reload_config" on first terminal
|
|
```
|
|
|
|
- This needs `macos-applescript = true`, which is the default.
|
|
- Inside Ghostty, this works without any prompt. In another terminal app, macOS
|
|
asks once whether that app may control Ghostty (System Settings → Privacy &
|
|
Security → Automation).
|
|
- Ghostty is never started just to reload it.
|
|
|
|
**Linux.** ghosttyconf sends `SIGUSR2` to your Ghostty processes, which the GTK
|
|
app handles as "reload config". Short-lived CLI calls such as
|
|
`ghostty +list-themes` are skipped.
|
|
|
|
A few options don't change open windows. For example, `macos-titlebar-style`
|
|
only applies to new windows, and `language` needs a full restart of Ghostty.
|
|
The documentation of an option mentions this where it matters.
|
|
|
|
Use `--no-reload` to only save. The status line then reminds you of the
|
|
shortcut.
|
|
|
|
## Troubleshooting
|
|
|
|
**"Ghostty refused the AppleScript command"**: your config sets
|
|
`macos-applescript = false`. Reload manually, or allow AppleScript.
|
|
|
|
**"not allowed to control Ghostty"**: the terminal you run ghosttyconf in
|
|
has no Automation permission for Ghostty. Enable it in System Settings →
|
|
Privacy & Security → Automation, or run ghosttyconf inside Ghostty.
|
|
|
|
**Options or documentation look outdated**: ghosttyconf takes the
|
|
documentation from the installed Ghostty. If Ghostty can't be found, pass
|
|
`--ghostty /path/to/ghostty`. The option list itself is built in. After a new
|
|
Ghostty release, see [Development](development.md#updating-for-a-new-ghostty-release).
|
|
|
|
**A key combination can't be recorded**: Ghostty or macOS handled it before
|
|
ghosttyconf could see it. Type it into the trigger field.
|
|
|
|
**Validation fails for an entry you didn't touch**: the problem was already
|
|
in your file. ghosttyconf marks invalid values in red. Fix or reset them, or
|
|
save anyway.
|