Go to file
Mitchell Hashimoto 608d312651 Support OSC133 click_events Kitty extension (supported by Fish) (#10536)
This adds support for the `OSC 133 A click_events=1` extension
introduced by Kitty and supported by Fish.[^1]

**What this means:** If the shell advertises `click_events=1` support,
Ghostty will _unconditionally_ (no modifier required) send mouse events
to the shell for clicks on a prompt line, delegating to the supporting
shell to move the cursor as needed. For Fish 4.1+ this means that
clicking on the prompt line moves the cursor (see demo video below).

This PR also contains:

* A minor fix in `cl` parsing but we don't yet implement the logic there
* Updated inspector to show the semantic prompt click mode

## Demo


https://github.com/user-attachments/assets/03ef8975-7ad9-441f-aaa2-9d0eb5c5e36d

## Implementation Details

`click_events` is wildly underspecified, so here are the details the
best I understand them. This itself is not a specification (I omit
details) but adds some more context to it.

The `click_events=1` option can be specified with `OSC 133 A` (Ghostty
also allows it on OSC 133 N). When that is specified, it flags for all
future prompts that the screen supports click events for semantic
prompts. If both `click_events` and `cl` are specified, `click_events`
takes priority if true. If `click_events=0` (disable), then any set `cl`
will take priority.

When a mouse click comes in, we check for the following conditions:

1. The screen supports click events
2. The screen cursor is currently at a prompt
3. The mouse click was at or below the starting prompt line of the
current prompt

If those are met, we encode an SGR mouse event with: left button, press,
coordinates of click. It is up to the shell after that to handle it. Out
of prompt bounds SGR events are possible (specifically below). The shell
should robustly handle this.

[^1]: I don't know any other terminal or shell that supports it at the
moment.
2026-02-02 10:57:30 -08:00
2025-12-30 13:30:18 +01:00
2026-02-01 00:20:14 +00:00
2025-07-29 12:10:42 -07:00
2026-02-01 14:32:37 -08:00
2026-01-12 12:53:21 -05:00
2026-01-06 10:26:40 +01:00
2025-11-06 12:56:43 -08:00
2024-02-05 21:22:27 -08:00
2025-11-20 08:30:08 -06:00
2023-10-07 14:51:45 -07:00
2025-10-05 20:16:42 -07:00
2026-01-12 12:53:21 -05:00
2025-07-04 14:12:18 -07:00
2025-10-30 13:14:23 -07:00
2023-12-12 11:38:39 -06:00
2025-12-23 11:23:03 -08:00

Logo
Ghostty

Fast, native, feature-rich terminal emulator pushing modern features.
About · Download · Documentation · Contributing · Developing

About

Ghostty is a terminal emulator that differentiates itself by being fast, feature-rich, and native. While there are many excellent terminal emulators available, they all force you to choose between speed, features, or native UIs. Ghostty provides all three.

In all categories, I am not trying to claim that Ghostty is the best (i.e. the fastest, most feature-rich, or most native). But Ghostty is competitive in all three categories and Ghostty doesn't make you choose between them.

Ghostty also intends to push the boundaries of what is possible with a terminal emulator by exposing modern, opt-in features that enable CLI tool developers to build more feature rich, interactive applications.

While aiming for this ambitious goal, our first step is to make Ghostty one of the best fully standards compliant terminal emulator, remaining compatible with all existing shells and software while supporting all of the latest terminal innovations in the ecosystem. You can use Ghostty as a drop-in replacement for your existing terminal emulator.

For more details, see About Ghostty.

Download

See the download page on the Ghostty website.

Documentation

See the documentation on the Ghostty website.

Contributing and Developing

If you have any ideas, issues, etc. regarding Ghostty, or would like to contribute to Ghostty through pull requests, please check out our "Contributing to Ghostty" document. Those who would like to get involved with Ghostty's development as well should also read the "Developing Ghostty" document for more technical details.

Roadmap and Status

The high-level ambitious plan for the project, in order:

# Step Status
1 Standards-compliant terminal emulation
2 Competitive performance
3 Basic customizability -- fonts, bg colors, etc.
4 Richer windowing features -- multi-window, tabbing, panes
5 Native Platform Experiences (i.e. Mac Preference Panel) ⚠️
6 Cross-platform libghostty for Embeddable Terminals ⚠️
7 Windows Terminals (including PowerShell, Cmd, WSL)
N Fancy features (to be expanded upon later)

Additional details for each step in the big roadmap below:

Standards-Compliant Terminal Emulation

Ghostty implements enough control sequences to be used by hundreds of testers daily for over the past year. Further, we've done a comprehensive xterm audit comparing Ghostty's behavior to xterm and building a set of conformance test cases.

We believe Ghostty is one of the most compliant terminal emulators available.

Terminal behavior is partially a de jure standard (i.e. ECMA-48) but mostly a de facto standard as defined by popular terminal emulators worldwide. Ghostty takes the approach that our behavior is defined by (1) standards, if available, (2) xterm, if the feature exists, (3) other popular terminals, in that order. This defines what the Ghostty project views as a "standard."

Competitive Performance

We need better benchmarks to continuously verify this, but Ghostty is generally in the same performance category as the other highest performing terminal emulators.

For rendering, we have a multi-renderer architecture that uses OpenGL on Linux and Metal on macOS. As far as I'm aware, we're the only terminal emulator other than iTerm that uses Metal directly. And we're the only terminal emulator that has a Metal renderer that supports ligatures (iTerm uses a CPU renderer if ligatures are enabled). We can maintain around 60fps under heavy load and much more generally -- though the terminal is usually rendering much lower due to little screen changes.

For IO, we have a dedicated IO thread that maintains very little jitter under heavy IO load (i.e. cat <big file>.txt). On benchmarks for IO, we're usually within a small margin of other fast terminal emulators. For example, reading a dump of plain text is 4x faster compared to iTerm and Kitty, and 2x faster than Terminal.app. Alacritty is very fast but we're still around the same speed (give or take) and our app experience is much more feature rich.

Note

Despite being very fast, there is a lot of room for improvement here.

Richer Windowing Features

The Mac and Linux (build with GTK) apps support multi-window, tabbing, and splits.

Native Platform Experiences

Ghostty is a cross-platform terminal emulator but we don't aim for a least-common-denominator experience. There is a large, shared core written in Zig but we do a lot of platform-native things:

  • The macOS app is a true SwiftUI-based application with all the things you would expect such as real windowing, menu bars, a settings GUI, etc.
  • macOS uses a true Metal renderer with CoreText for font discovery.
  • The Linux app is built with GTK.

There are more improvements to be made. The macOS settings window is still a work-in-progress. Similar improvements will follow with Linux.

Cross-platform libghostty for Embeddable Terminals

In addition to being a standalone terminal emulator, Ghostty is a C-compatible library for embedding a fast, feature-rich terminal emulator in any 3rd party project. This library is called libghostty.

Due to the scope of this project, we're breaking libghostty down into separate actually libraries, starting with libghostty-vt. The goal of this project is to focus on parsing terminal sequences and maintaining terminal state. This is covered in more detail in this blog post.

libghostty-vt is already available and usable today for Zig and C and is compatible for macOS, Linux, Windows, and WebAssembly. At the time of writing this, the API isn't stable yet and we haven't tagged an official release, but the core logic is well proven (since Ghostty uses it) and we're working hard on it now.

The ultimate goal is not hypothetical! The macOS app is a libghostty consumer. The macOS app is a native Swift app developed in Xcode and main() is within Swift. The Swift app links to libghostty and uses the C API to render terminals.

Crash Reports

Ghostty has a built-in crash reporter that will generate and save crash reports to disk. The crash reports are saved to the $XDG_STATE_HOME/ghostty/crash directory. If $XDG_STATE_HOME is not set, the default is ~/.local/state. Crash reports are not automatically sent anywhere off your machine.

Crash reports are only generated the next time Ghostty is started after a crash. If Ghostty crashes and you want to generate a crash report, you must restart Ghostty at least once. You should see a message in the log that a crash report was generated.

Note

Use the ghostty +crash-report CLI command to get a list of available crash reports. A future version of Ghostty will make the contents of the crash reports more easily viewable through the CLI and GUI.

Crash reports end in the .ghosttycrash extension. The crash reports are in Sentry envelope format. You can upload these to your own Sentry account to view their contents, but the format is also publicly documented so any other available tools can also be used. The ghostty +crash-report CLI command can be used to list any crash reports. A future version of Ghostty will show you the contents of the crash report directly in the terminal.

To send the crash report to the Ghostty project, you can use the following CLI command using the Sentry CLI:

SENTRY_DSN=https://e914ee84fd895c4fe324afa3e53dac76@o4507352570920960.ingest.us.sentry.io/4507850923638784 sentry-cli send-envelope --raw <path to ghostty crash>

Warning

The crash report can contain sensitive information. The report doesn't purposely contain sensitive information, but it does contain the full stack memory of each thread at the time of the crash. This information is used to rebuild the stack trace but can also contain sensitive data depending on when the crash occurred.

Description
👻 Ghostty is a fast, feature-rich, and cross-platform terminal emulator that uses platform-native UI and GPU acceleration.
Readme MIT 180 MiB
Languages
Zig 78.6%
Swift 11.6%
C 6.8%
Shell 0.6%
HTML 0.6%
Other 1.7%