Basic Keybinding Syntax
Keybindings use the formattrigger=action:
Trigger Syntax
Triggers are+-separated keys and modifiers:
Valid Modifiers
| Modifier | Aliases | Description |
|---|---|---|
shift | - | Shift key |
ctrl | control | Control key |
alt | opt, option | Alt/Option key |
super | cmd, command | Super/Command/Windows key |
The
fn or “globe” key is not supported as a modifier (OS/toolkit limitation).Key Specifications
Unicode Codepoints
Keys can be Unicode characters:Codepoint matching is layout-aware.
ctrl+a matches the key that produces ‘a’ on your keyboard layout.Physical Key Codes
Use W3C key codes for layout-independent binding:Function Keys
Priority Rules
Physical keys have higher priority than Unicode codepoints. If you bind both
a and KeyA, the physical key binding always wins.Special Keys
Catch-All Key
Match any unbound key:How does catch_all lookup work?
How does catch_all lookup work?
- Try to match
catch_allwith modifiers first - If no match and event has modifiers, fall back to
catch_allwithout modifiers
Actions
Action Format
Actions can have optional parameters:Common Actions
Text Input
Text uses Zig string literal syntax. Common escapes:
\n (newline), \t (tab), \xHH (hex byte).Terminal Sequences
Special Actions
What does unbind do?
What does unbind do?
unbind removes the binding and allows the key to pass through to the terminal application if printable. It removes any matching trigger, including physical:-prefixed ones.Action Parameters
Keybind Prefixes
Prefixes modify keybind behavior:Global Keybinds
- macOS
- Linux
Requires Accessibility permissions. Ghostty will request these when a
global: keybind is detected.Find in: System Settings → Privacy & Security → Accessibilityglobal: implies all: (applies to all surfaces).All Surfaces
Unconsumed Input
Performable Actions
copy_to_clipboard only triggers if there’s a selection.
Performable keybinds won’t appear as menu shortcuts because menus force the action regardless of state.
Combining Prefixes
Multiple prefixes can be used:Key Sequences
Bind sequences of keys (leader keys, key chords):ctrl+a, then n to trigger new_window.
Sequence Behavior
What happens if I press an unbound key during a sequence?
What happens if I press an unbound key during a sequence?
- If a
catch_allbinding exists that wouldignorethe input, the entire sequence is dropped - Otherwise, the entire sequence is sent to the terminal as if no keybind existed
How do I output a prefix key?
How do I output a prefix key?
Ghostty waits indefinitely for the next key. To force output of the prefix:
- Bind another key to send it:
ctrl+a>ctrl+a=text:... - Press an unbound key (sends both keys to terminal)
What if I bind a prefix that was already bound?
What if I bind a prefix that was already bound?
Sequences override previous prefix bindings:Binding a previously-sequenced prefix unbinds all its sequences:
Chained Actions
Execute multiple actions from one keybind:ctrl+a to:
- Open a new window
- Move focus left
- Toggle fullscreen
Each
chain entry appends to the most recent keybind. You can chain as many actions as you want.Chains with Sequences
Chains work with key sequences:Chained keybinds available since Ghostty 1.3.0.
Key Tables
Create named sets of keybindings (modal input):Key tables are defined using
<table>/<binding> syntax. Table names can contain anything except /, =, +, and >.Table Operations
Table Lookup
Binding lookup proceeds from the innermost table outward. Keybinds in the default table remain available unless explicitly unbound in an inner table.
Table Stacking
Can I activate the same table twice?
Can I activate the same table twice?
You cannot activate a table that is already the innermost table. However, the same table can appear multiple times in the stack:✅ Valid:
❌ Invalid:
A → B → A → B❌ Invalid:
A → B → BTables with Other Features
Key tables available since Ghostty 1.3.0.
Managing Keybindings
Clear All Keybinds
Unbind Specific Keys
Show Active Keybinds
Example Configurations
Vim-Style Navigation
Tmux-Style Leader Key
Copy Mode (Key Table)
Platform-Specific Keybinds
- macOS
- Linux
Resources
List Actions
Run
ghostty +list-actions for all available actionsList Keybinds
Run
ghostty +list-keybinds to see active bindingsW3C Key Codes
Physical key code reference
Qt Keyboard Issues
Understanding keyboard layout limitations