Skip to content

macOS: respond to standard keybindings for cursor manipulation #2838

@BernieSumption

Description

@BernieSumption

From a UX perspective this is related to #2526 but I think it's a different request technically so I'm submitting a new issue

In almost every text field in macOS applications the following keybindings apply:

  • LeftArrow / RightArrow: move cursor one character left / right (This is the only one Ghostty does)
  • Cmd+LeftArrow / Cmd+RightArrow : move cursor to start / end of current line (if text is soft wrapping, line is the wrapped on-screen line, not the newline character)
  • Option+LeftArrow / Option+RightArrow: move cursor to next / previous word
  • Shift+ any of the above: move the cursor in the same way and create or extend a text selection from the previous to the new cursor position

Using any of these keys (and they are very much in my muscle memory) in Ghostty prints codes to the screen e.g. ;9D for Command+LeftArrow.

The Mac only terminal partially implements these shortcuts, it does the most useful ones Option+LeftArrow / Option+RightArrow which I use all the time for editing commands, but doesn't do the rest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions