I described Ghostty nightly as supporting the click_events extension introduced by Kitty and supported by Fish.
With Fish 4.1+, I said users can click anywhere at a prompt without modifiers to move the mouse.
I believe Ghostty is the first to support this extension outside of Kitty.
As far as I can find, the only shell to support this is Fish (4.1+).
I said Kitty was the only terminal to support the extension previously.
I said Ghostty had supported moving the cursor with the mouse since 1.0, as do other terminals to some extent.
Before click_events, Ghostty best-effort calculates a number of synthetic left arrow key inputs to pretend to move the cursor.
I said this approach can't take into account shell behaviors particularly around indention, multi-line, and if you're not at a prompt at all.
The click_events extension allows Ghostty to know when you're at a prompt line.
The extension works by encoding a mouse click event while at a prompt line to the shell.
The shell then takes over and handles all the logic of moving the cursor, which I said makes the most sense.
I’d welcome broader support across shells and terminals. The implementation’s division of responsibility—Ghostty reports the click and the shell handles cursor movement—avoids trying to infer shell-specific behavior in the terminal.
I linked the click_events work to PR: https://t.co/CuSropnpgi.
I reported more libghostty C progress with encoding APIs for mouse reports, focus events, and mode reports.
I reported mode read/write on terminals as part of the C API progress.
The current goal is to expose all major event/response formats as high level APIs.
The core idea is to minimize the glue between UI framework events (mouse events, key inputs, focus, etc.) and libghostty to provide accurate terminal emulation.
This high-level event API direction extends my broader work to expose libghostty functionality through C APIs; see expanding c api capabilities.
I build Ghostty’s terminal input around cross-platform key events and platform-agnostic encoding, while accounting for differences in how operating systems and applications handle keyboard input.
I’m super proud of Ghostty’s comprehensive keyboard encoding tests.
As a result, Ghostty has one of the most comprehensive and accurate key encoding implementations and is very resilient to regressions.
The encoder is platform agnostic: it takes a cross-platform “KeyEvent” as input and produces the proper encoded bytes as output.
I expect platform-specific code, including AppKit on macOS, GTK on Linux, etc., to produce the KeyEvent.
I’ve found that between AppKit and GTK they handle keyboard input VERY differently, so I work to ensure cross-platform runtimes produce equivalent key events.
I'm certain we have many keyboard encoding bugs still, but I'm also confident that as we get them and resolve them, the existing edge behaviors are preserved.
In this case, four macOS input bugs resolved. I’m focusing in on input issues for the next Ghostty release.
I'm focusing in on input issues for the next Ghostty release so there are more that will be resolved soon (for Linux, too).
I said Claude code appends to Ghostty (and others) configs, breaking Shift-Enter for everyone else.
I attributed the key-encoding problem to Ink: it can’t understand basic key encodings.
I gave the example, “Kitty keyboard protocol, but extend that to about 100 other features.”
Related: terminal behavior compatibility, text input and keyboard handling, terminal app extensibility