Your Ghostty Keybindings Are Broken (Here's the 60-Second Fix)

Published: (February 3, 2026 at 11:44 AM EST)
2 min read
Source: Dev.to

Source: Dev.to

Introduction

You know that thing where you press ⌘← to jump to the start of a line and Ghostty just… prints ^A?
Let’s fix that.

macOS has beautiful text navigation shortcuts:

  • ⌥← / ⌥→ – Jump by word
  • ⌘← / ⌘→ – Jump to start/end of line
  • ⌘⌫ – Delete everything before the cursor

These work everywhere—Notes, VS Code, your browser—except Ghostty. Instead you get garbage like this:

python -m venv .venv && source .venv/activate^E^A^E^A

Not great.

Fix the keybindings

  1. Create or edit your Ghostty config

    mkdir -p ~/.config/ghostty
    nano ~/.config/ghostty/config
  2. Add this line (the file uses a simple key = value format):

    macos-option-as-alt = true
  3. Save and restart Ghostty (it doesn’t hot‑reload config changes).

  4. Make sure your shell interprets the escape codes

    bindkey -e

    If it works, make it permanent:

    echo "bindkey -e" >> ~/.zshrc

That’s it. You’re done.

Those ^A and ^E characters are actually the correct escape codes for “beginning of line” and “end of line”—your shell just wasn’t listening.

Keybinding reference

ShortcutWhat it sendsAction
⌘←Ctrl+ABeginning of line
⌘→Ctrl+EEnd of line
⌥←\x1bbBack one word
⌥→\x1bfForward one word

The bindkey -e command puts zsh into Emacs mode, which is what makes it understand these codes. Some shell configurations (especially if you’re using oh‑my‑zsh or other frameworks) might override this, so adding it explicitly is a good idea.

If you switched from Warp to Ghostty, this is probably the first thing that felt broken. Warp handles these shortcuts natively because it’s built differently. Ghostty is a traditional terminal emulator, so it needs a little help.

Now you’ve got the best of both worlds—Ghostty’s speed and simplicity with the keybindings your fingers expect.

Tested on Ghostty + zsh on macOS.

Back to Blog

Related posts

Read more »