Skip to main content

Basic Keybinding Syntax

Keybindings use the format trigger=action:
List all actions:
Show active keybinds:

Trigger Syntax

Triggers are +-separated keys and modifiers:

Valid Modifiers

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.
Some combinations are impossible depending on keyboard layout. For example, ctrl+_ is impossible on US keyboards because _ requires Shift, making it ctrl+shift+-, not ctrl+_.See Qt keyboard layout documentation for details.

Physical Key Codes

Use W3C key codes for layout-independent binding:
Physical keys also support snake_case: key_a equals KeyA, bracket_left equals BracketLeft.Exception: Function keys use lowercase without underscore: f1, f2, etc.

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:
  1. Try to match catch_all with modifiers first
  2. If no match and event has modifiers, fall back to catch_all without 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

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

Parameters are taken as-is after the :. If you need spaces, wrap the entire keybind in quotes:

Keybind Prefixes

Prefixes modify keybind behavior:

Global Keybinds

Works system-wide, even when Ghostty isn’t focused.
Requires Accessibility permissions. Ghostty will request these when a global: keybind is detected.Find in: System Settings → Privacy & Security → Accessibility
global: implies all: (applies to all surfaces).

All Surfaces

Applies action to all terminal surfaces, not just the focused one.

Unconsumed Input

Executes action and sends the key to the terminal application.
global: and all: keybinds always consume input (they’re not tied to a specific surface).

Performable Actions

Only consumes input if the action can be performed. For example, 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):
Press ctrl+a, then n to trigger new_window.
When using key sequences in CLI arguments, quote the value (since > is a special shell character):

Sequence Behavior

  • If a catch_all binding exists that would ignore the input, the entire sequence is dropped
  • Otherwise, the entire sequence is sent to the terminal as if no keybind existed
Ghostty waits indefinitely for the next key. To force output of the prefix:
  1. Bind another key to send it: ctrl+a>ctrl+a=text:...
  2. Press an unbound key (sends both keys to terminal)
Sequences override previous prefix bindings:
Binding a previously-sequenced prefix unbinds all its sequences:
Key sequences are not allowed for global: or all: keybinds.

Chained Actions

Execute multiple actions from one keybind:
This binds ctrl+a to:
  1. Open a new window
  2. Move focus left
  3. Toggle fullscreen
Each chain entry appends to the most recent keybind. You can chain as many actions as you want.
Chained actions cannot have prefixes like global: or unconsumed:. The flags from the original keybind apply to the entire chain.

Chains with Sequences

Chains work with key sequences:
Chains apply to the most recent binding in the sequence.
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

You cannot activate a table that is already the innermost table. However, the same table can appear multiple times in the stack:✅ Valid: A → B → A → B
❌ Invalid: A → B → B

Tables with Other Features

Key tables available since Ghostty 1.3.0.

Managing Keybindings

Clear All Keybinds

This removes ALL keybindings, including defaults! Use carefully.

Unbind Specific Keys

Show Active Keybinds

Example Configurations

Vim-Style Navigation

Tmux-Style Leader Key

Copy Mode (Key Table)

Platform-Specific Keybinds

Resources

List Actions

Run ghostty +list-actions for all available actions

List Keybinds

Run ghostty +list-keybinds to see active bindings

W3C Key Codes

Physical key code reference

Qt Keyboard Issues

Understanding keyboard layout limitations