Skip to main content
Ghostty Config includes a powerful keybinding editor with sequence support, validation, and a visual builder for creating custom keyboard shortcuts.

Accessing Keybinds

Access keybinding settings from the Keybinds category in the navigation sidebar.
For detailed information on Ghostty’s keybinding format and available actions, refer to Ghostty’s keybind documentation.

The Keybind Editor

The keybind editor displays all your keybindings in a list with visual validation:
// From Keybinds.svelte
<div class="item-list">
  {#each value as _, i (i)}
    <div
      class="keybind"
      class:selected={selected.includes(i)}
      class:invalid={diagnostics[i]?.status === "invalid"}
      class:duplicate={diagnostics[i]?.duplicate}
    >
      <Text value={value[i].split("=")[0]} blank={true} align="left" change={update(i)} />
      <Text value={value[i].split("=")[1]} blank={true} change={update(i, true)} />
    </div>
  {/each}
</div>

Visual Indicators

Keybindings are color-coded based on their status:
  • Normal: Standard display
  • Selected: Blue highlight when clicked
  • Duplicate: Orange indicator for duplicate key combinations
  • Invalid: Red indicator for invalid syntax
.keybind.selected {
  background: #2457c9;
}

.keybind.duplicate {
  box-shadow: inset 4px 0 0 rgba(255, 196, 70, 0.7);
  background: rgba(255, 196, 70, 0.08);
}

.keybind.invalid {
  box-shadow: inset 4px 0 0 rgba(255, 106, 106, 0.8);
  background: rgba(255, 90, 90, 0.12);
}

Keybind Format

Ghostty keybindings follow the format:
keybind = modifier+key=action:argument

Components

Available modifiers:
  • super - Cmd (macOS) or Windows key (Linux/Windows)
  • ctrl - Control key
  • alt - Alt/Option key
  • shift - Shift key
Combine multiple modifiers with +:
super+ctrl+t=new_tab
super+shift+enter=toggle_fullscreen

Adding Keybindings

1

Click the + button

Click the + button in the bottom toolbar to open the keybind editor
2

Build your keybind

Use the visual builder to construct your keybinding:
  • Select modifiers (Cmd, Ctrl, Alt, Shift)
  • Choose a key
  • Pick an action
  • Add arguments if needed
3

Save

Click Save to add the keybinding to your list
// From Keybinds.svelte
function addNew() {
  editorMode = "add";
  editorValue = "";
  showEditor = true;
}

function handleSave(detail: string) {
  if (editorMode === "add") {
    value = [...value, detail];
    
    // Scroll to the new item
    setTimeout(() => {
      if (scroller) scroller.scrollTop = scroller.scrollHeight;
    }, 1);
  }
  showEditor = false;
}

Editing Keybindings

1

Select a keybind

Click a keybinding in the list to select it
2

Click edit button

Click the edit button (pencil icon) in the toolbar
3

Modify in editor

Make your changes in the visual editor
4

Save changes

Click Save to apply your changes
// From Keybinds.svelte
function editSelected() {
  if (selected.length !== 1) return;
  editorMode = "edit";
  editorValue = value[selected[0]];
  showEditor = true;
}
You can also edit keybindings inline by clicking directly on the key combination or action text.

Removing Keybindings

1

Select keybind(s)

Click one or more keybindings to select them. Hold Ctrl/Cmd to select multiple.
2

Click remove button

Click the button in the toolbar
3

Keybinds removed

Selected keybindings are removed from the list
// From Keybinds.svelte
function remove() {
  value = value.filter((v, i) => {
    const shouldRemove = selected.includes(i);
    return !shouldRemove;
  });
  selected = [];
}

Multi-Selection

Select multiple keybindings to batch delete:
// From Keybinds.svelte
function select(index: number) {
  return (event: MouseEvent | KeyboardEvent) => {
    if (!event.ctrlKey) return (selected = [index]);
    if (!selected.includes(index)) return selected.push(index);
    selected.splice(selected.indexOf(index), 1);
  };
}
  • Click: Select single keybinding
  • Ctrl+Click: Toggle selection (add/remove from selection)
  • Escape: Clear selection

Keybind Validation

The editor validates keybindings in real-time:
// From Keybinds.svelte
const diagnostics = $derived.by(() => getDiagnostics(value));

Validation Checks

The editor warns when multiple keybindings use the same key combination:
// From keybinds.ts (conceptual)
function getDiagnostics(keybinds) {
  const seen = {};
  return keybinds.map(kb => {
    const [key, action] = kb.split("=");
    if (seen[key]) {
      return { duplicate: true };
    }
    seen[key] = true;
    return {};
  });
}
Duplicates show an orange indicator.
Invalid keybind syntax is flagged with a red indicator.Common issues:
  • Missing = separator
  • Invalid modifier names
  • Unknown key names
  • Malformed action syntax

Default Keybindings

Ghostty Config includes Ghostty’s default keybindings:
// From settings.ts (excerpt)
{
  id: "keybind", 
  name: "", 
  type: "keybinds", 
  value: [
    "super+t=new_tab",
    "super+w=close_surface",
    "super+enter=toggle_fullscreen",
    "super+d=new_split:right",
    "super+shift+bracket_left=previous_tab",
    "super+shift+bracket_right=next_tab",
    "super+c=copy_to_clipboard",
    "super+v=paste_from_clipboard",
    "super+equal=increase_font_size:1",
    "super+minus=decrease_font_size:1",
    // ... many more
  ]
}

Resetting to Defaults

1

Click reset button

Click the reset button (circular arrow icon) in the toolbar
2

Confirm reset

A confirmation dialog appears asking “Are you sure?”
3

Confirm

Click Reset Keybinds to restore all default keybindings
// From Keybinds.svelte
const defaultKeybinds = (() => {
  const panel = settings.find((entry) => entry.id === "keybinds");
  const group = panel?.groups.find((entry) => entry.id === "keybinds");
  const setting = group?.settings.find((entry) => entry.type === "keybinds");
  return (setting?.value as string[]) ?? [];
})();

function resetDefaults() {
  value = [...defaultKeybinds];
  selected = [];
  showReset = false;
  if (scroller) scroller.scrollTop = 0;
}
Resetting keybindings will overwrite all your custom keybindings. There is no undo.

Common Keybinding Examples

# Create new tab
keybind = super+t=new_tab

# Close current tab/pane
keybind = super+w=close_surface

# Navigate tabs
keybind = super+shift+bracket_left=previous_tab
keybind = super+shift+bracket_right=next_tab

# Go to specific tab
keybind = super+physical:one=goto_tab:1
keybind = super+physical:two=goto_tab:2

Special Key Sequences

Ghostty supports advanced key sequences:

Text Input

Send literal text or control codes:
# Send Ctrl+A (start of line)
keybind = super+arrow_left=text:\x01

# Send Ctrl+E (end of line)
keybind = super+arrow_right=text:\x05

# Send Ctrl+U (delete line)
keybind = super+backspace=text:\x15

Escape Sequences

Send escape sequences:
# Alt+Left (word back)
keybind = alt+arrow_left=esc:b

# Alt+Right (word forward)
keybind = alt+arrow_right=esc:f

Physical Keys

Use physical: prefix for layout-independent bindings:
# Always use physical key positions regardless of layout
keybind = super+physical:one=goto_tab:1
keybind = super+physical:two=goto_tab:2
Physical keys are useful for:
  • Tab switching (always in same position)
  • Gaming-style bindings
  • Consistent bindings across keyboard layouts

Exporting Keybindings

Keybindings are exported with only custom bindings:
// From config.svelte.ts - diff() function
if (Array.isArray(config[key]) && key === "keybind") {
  const toAdd = config[key].filter(c => !defaults[key].includes(c));
  if (toAdd.length) output[keyToConfig(key)] = toAdd;
}
Example exported output:
# Only custom keybindings are exported
keybind = super+shift+t=new_tab
keybind = ctrl+tab=next_tab
keybind = ctrl+shift+tab=previous_tab
Only keybindings that differ from Ghostty’s defaults are exported. This keeps your config file clean and portable across Ghostty updates.

Keyboard Shortcuts in the Editor

Escape

Clear selection when viewing the keybind list

Ctrl+Click

Toggle selection (add/remove from selection)

Click

Select single keybinding

Inline Edit

Click key or action text to edit directly

Best Practices

Be careful not to override important system or application shortcuts. The duplicate indicator helps identify conflicting bindings.
Stick to a consistent modifier pattern (e.g., always use super for window management) to build muscle memory.
Use comments in your exported config to explain non-obvious keybindings.
Test new keybindings in Ghostty before committing to them. Some combinations may conflict with shell or application shortcuts.
Begin with a few essential custom bindings rather than customizing everything at once.

Troubleshooting

If a keybinding isn’t working:
  1. Check for duplicate bindings in the list
  2. Verify the syntax is valid (no red indicator)
  3. Ensure the key name is correct
  4. Test if the key combination conflicts with OS shortcuts
  5. Check Ghostty’s logs for errors

Build docs developers (and LLMs) love