Commit Graph

15916 Commits

Author SHA1 Message Date
Mitchell Hashimoto
61363e80d1 macOS: fix App Icon update in Finder (#12344)
Looks like `NSWorkspace.shared.setIcon` can only be called from the main
App, DockTilePlugin is sandboxed and doesn't have the permission to
`file-write-finderinfo`.

<img width="1186" height="144" alt="image"
src="https://github.com/user-attachments/assets/e5ea4f1c-718c-493a-bda2-32787881881e"
/>


It works fine in debug, but not in release. This fixes #11489
2026-04-20 11:52:43 -07:00
Lukas
afdae7293a macos: add pid and tty properties to AppleScript terminal and App Intents TerminalEntity (#11922) 2026-04-20 18:10:57 +02:00
Mitchell Hashimoto
4446dbae33 Misc APC improvements (#12349)
* Fix a memory leak when invalid Kitty graphics data is sent via APC
(this is the only commit for backporting to 1.3.2)
* Add `max_bytes` to limit size of buffered APC data by protocol to
prevent DoS, default to reasonable values
* libghostty: expose max bytes APC options
2026-04-20 09:10:50 -07:00
Mitchell Hashimoto
0069e28cc6 libghostty: expose the APC max byte limits 2026-04-20 08:57:51 -07:00
Mitchell Hashimoto
0509f00ad2 terminal/apc: introduce a max_bytes parameter to prevent DoS 2026-04-20 08:53:02 -07:00
Mitchell Hashimoto
83027407e6 terminal: fix memory leak that could happen with invalid Kitty image cmd 2026-04-20 08:45:41 -07:00
Christo Wilken
9a9002202b macos: add pid and tty properties to AppleScript terminal class
Expose the foreground process PID and TTY device path as read-only properties on the AppleScript terminal class and App Intents TerminalEntity. This enables reliable process-to-terminal mapping for automation tools when multiple terminals share the same CWD.

Closes #11592
Closes #10756

Session: 019d341c-a165-7843-a2f7-2f426114cf17
2026-04-20 15:16:03 +02:00
Lukas
c7a73076e9 macOS: fix App Icon update in Finders
Looks like  `NSWorkspace.shared.setIcon` can only be called from the main App, DockTilePlugin is sandboxed and doesn't have the permission to `file-write-finderinfo`.

It works fine in debug, but not in release. This fixes #11489, #11290
2026-04-20 12:56:55 +02:00
Mitchell Hashimoto
dcc39dcd40 android: Avoid referencing POSIX shared memory functions (#12341)
Stop trying to use POSIX shared memory functions such as `shm_open` on
Android as it's unsupported and the platform libc does not have those
symbols.

This avoids an error such as the below when trying to use
`libghostty-vt` on Android:

> dlopen failed: cannot locate symbol "shm_open" referenced by [..]
2026-04-19 15:21:26 -07:00
Fredrik Fornwall
adb0d793af android: Avoid referencing POSIX shared memory functions
Stop trying to use POSIX shared memory functions such as
`shm_open` on Android as it's unsupported and the platform libc does not
have those symbols.

This avoids an error such as the below when trying to use
`libghostty-vt` on Android:

> dlopen failed: cannot locate symbol "shm_open" referenced by [..]
2026-04-19 23:44:37 +02:00
ghostty-vouch[bot]
d69d937a93 Update VOUCHED list (#12340)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/12339#discussioncomment-16627477)
from @jcollie.

Vouch: @fornwall

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-04-19 21:38:47 +00:00
Kat
ed29fd56dd Translation documentation-related typos + CODEOWNERS update (#12336) 2026-04-19 20:42:30 +00:00
Kat
2e33589e23 Avoid marking files as owned by ghostty-org/localization.
That team and its children have a very large number of members, so
requests for review from them would make for a mass ping.
2026-04-20 06:23:55 +10:00
Kat
49cd2ba80b Mark i18n_locales.zig as owned by ghostty-org/localization/manager. 2026-04-20 01:25:08 +10:00
Kat
8a6c664686 Fix typo in i18n_locales.zig. 2026-04-20 01:22:09 +10:00
Kat
9cbca54597 Fix typo + improve fluency in README_TRANSLATORS § Viewing translations. 2026-04-20 01:22:09 +10:00
Kat
28b7ef12c3 i18n: add Belarusian translation (be) (#12284)
This PR adds Belarusian (be) language support to Ghostty.

## Changes

- `po/be.po` — new Belarusian translation file (80 strings)
- `src/os/i18n_locales.zig` — added `be` locale
- `CODEOWNERS` — added `/po/be.po @ghostty-org/be_BY`

## Notes

Terminology was cross-referenced with:
- KDE Belarusian translations (l10n.kde.org)
- qBittorrent Belarusian translation
- far2l Belarusian translation
- Ubuntu Belarusian Translators Dictionary
2026-04-19 14:48:32 +00:00
Lukas
7a3e3dc8d2 macOS: fix #12266 by using the correct coordinates for the hitTest (#12322)
Fixes #12266, regression of #11872.
2026-04-19 15:51:49 +02:00
Illia Krauchanka
f370099d34 i18n: address review feedback (be) 2026-04-19 08:35:31 -03:00
Lukas
5939b8c1be macOS: fix 12266 by using the correct coordinates for the hitTest
Regression of #11872
2026-04-17 20:05:18 +02:00
Mitchell Hashimoto
ca7516bea6 macOS: move KeyStateIndicator on top of exit bar (#12282) 2026-04-16 20:33:48 -07:00
ghostty-vouch[bot]
9e080c5a40 Update VOUCHED list (#12302)
Triggered by
[comment](https://github.com/ghostty-org/ghostty/issues/12301#issuecomment-4255856979)
from @trag1c.

Vouch: @bleikurr

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-04-15 21:56:04 +00:00
Mitchell Hashimoto
d85051a530 macOS: fix shortcuts not showing on menu item for scroll_to_selection and search_selection (#12281)
…

Incorrect link after 9b6a3be993 and
7d0157e69a

Reload following config and see the menu
```
keybind = cmd+j=scroll_to_selection
keybind = cmd+m=search_selection
```

<img width="473" height="222" alt="image"
src="https://github.com/user-attachments/assets/f92c6024-e7f4-496d-9aed-43103c21794d"
/>
2026-04-15 14:15:38 -07:00
Mitchell Hashimoto
551bf0af3f terminal: fix viewport pin during resize reflow (#12300)
Maybe related to #12298?

When Screen resize forwards the active cursor into PageList reflow, a
history-pinned viewport can be remapped into the active area before the
preserved-cursor grow step finishes. The old code kept treating that
viewport as a history pin during the intermediate grow calls, which left
too few rows beneath the pin and tripped the viewport integrity checks.

Fix this by normalizing the viewport back to active as soon as reflow
moves the pinned row into the active area. Add a Screen-level regression
test that exercises the full resize path with bounded scrollback and
wrapped rows, and document the setup so the unwrap and viewport
transition are clear.
2026-04-15 14:04:09 -07:00
Mitchell Hashimoto
815ccb060b terminal: fix viewport pin during resize reflow
Maybe related to #12298?

When Screen resize forwards the active cursor into PageList reflow, a
history-pinned viewport can be remapped into the active area before the
preserved-cursor grow step finishes. The old code kept treating that
viewport as a history pin during the intermediate grow calls, which left
too few rows beneath the pin and tripped the viewport integrity checks.

Fix this by normalizing the viewport back to active as soon as reflow
moves the pinned row into the active area. Add a Screen-level regression
test that exercises the full resize path with bounded scrollback and
wrapped rows, and document the setup so the unwrap and viewport
transition are clear.
2026-04-15 13:59:54 -07:00
Mitchell Hashimoto
43a05dc968 libghostty: Remove all libc++ and libc++ ABI dependencies (#12291)
This updates simdutf to my fork which has a SIMDUTF_NO_LIBCXX option
that removes all libc++ and libc++ ABI dependencies. The plan is to open
an upstream PR with this, but I want to verify it here first.

From there, the hand-written simd code we have has been updated to also
no longer use any libc++ features. Part of this required removing utfcpp
since it depended on libc++ (`<iterator>`).

libghostty-vt now only depends on libc.

## Benchmark Results

| Corpus | Current `HEAD` median | `main` median | Delta vs `main` |
Notes |
| --- | ---: | ---: | ---: | --- |
| `valid-mixed-1g-seed1.bin` | `9.245s` | `9.111s` | `1.5%` slower |
Near tie; `main` remains slightly faster on fully valid input |
| `malformed-mixed-1g-seed1-rate0.005.bin` | `9.251s` | `12.705s` |
`37.3%` faster | Large improvement on malformed UTF-8 input |

Approximate throughput from the medians:

- Valid corpus: current `HEAD` `110.8 MiB/s`, `main` `112.4 MiB/s`
- Malformed corpus: current `HEAD` `110.7 MiB/s`, `main` `80.6 MiB/s`
2026-04-15 11:36:16 -07:00
Mitchell Hashimoto
e51de8b58f libghostty: Remove all libc++ and libc++ ABI dependencies
This updates simdutf to my fork which has a SIMDUTF_NO_LIBCXX option
that removes all libc++ and libc++ ABI dependencies. 

From there, the hand-written simd code we have has been updated to also
no longer use any libc++ features. Part of this required removing utfcpp
since it depended on libc++ (`<iterator>`).

libghostty-vt now only depends on libc.
2026-04-15 10:27:05 -07:00
Mitchell Hashimoto
efa8da6aea nix: update to the latest zon2nix (#12299) 2026-04-15 09:26:29 -07:00
Jeffrey C. Ollie
f53d3ab8a3 nix: update to the latest zon2nix 2026-04-15 11:21:25 -05:00
Mitchell Hashimoto
29f92c0c8b benchmark: add AGENTS, improve UTF-8 synthetic data (#12297)
This updates our synthetic generator for UTF-8 to expose:

  - Flags to change 1/2/3/4-byte UTF-8 character distribution
- Flags to have only printable characters so we can benchmark pure UTF-8
vs our control sequence finder.
- Flags to have invalid characters so we can benchmark our error
handling.

This also adds an AGENTS.md to src/benchmark so agents can do the right
thing more easily.

These are necessary to robustly benchmark our libc++ removal PR.
2026-04-15 09:09:11 -07:00
Mitchell Hashimoto
9c49c34356 benchmark: add AGENTS, improve UTF-8 synthetic data
This updates our synthetic generator for UTF-8 to expose:

  - Flags to change 1/2/3/4-byte UTF-8 character distribution
  - Flags to have only printable characters so we can benchmark
    pure UTF-8 vs our control sequence finder.
  - Flags to have invalid characters so we can benchmark our error
    handling.

This also adds an AGENTS.md to src/benchmark so agents can do the right
thing more easily.
2026-04-15 08:28:36 -07:00
ghostty-vouch[bot]
49a43bf560 Update VOUCHED list (#12285)
Triggered by
[comment](https://github.com/ghostty-org/ghostty/issues/12284#issuecomment-4247088526)
from @trag1c.

Vouch: @illiakrauchanka

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-04-14 20:55:42 +00:00
illia krauchanka
053dee8db2 i18n: replace гартаць with пракручваць (be) 2026-04-14 17:51:36 -03:00
illia krauchanka
43811534b9 i18n: replace змесціва with змест (be) 2026-04-14 17:43:55 -03:00
illia krauchanka
3ee0b0a77b i18n: fix gender agreement for match translations (be) 2026-04-14 17:43:37 -03:00
illia krauchanka
ff9ca55b58 i18n: fix terminology in Belarusian translation (be) 2026-04-14 17:42:44 -03:00
illia krauchanka
4f3a9cb0c6 i18n: add Belarusian translation (be) 2026-04-14 17:27:37 -03:00
Lukas
b7d0be8e74 macOS: move KeyStateIndicator on top of exit bar 2026-04-14 19:55:46 +02:00
Lukas
858e856e2e macOS: fix shortcuts not showing on menu item for scroll_to_selection and search_selection
Incorrect link after 9b6a3be993 and 7d0157e69a
2026-04-14 19:21:16 +02:00
Mitchell Hashimoto
79a470d9a3 macOS: refactor MenuShortcutManager (#12271)
Closes #11995

Yet another small step to fix menu shortcut-related issues.

1. Create `MenuShortcutKey` from `NSMenuItem` and `KeyboardShortcut`.
2. Add `updateMenuShortcut` to update to Ghostty ones only.

Doesn't contain any actual changes to pass previous test cases.
2026-04-14 07:05:10 -07:00
Lukas
6033c12790 macOS: reset menu shortcuts when its not updated 2026-04-13 19:59:20 +02:00
Lukas
fe8a6464b9 macOS: update MenuShortcutKey 2026-04-13 19:56:56 +02:00
ghostty-vouch[bot]
158b97607c Update VOUCHED list (#12268)
Triggered by
[comment](https://github.com/ghostty-org/ghostty/issues/12267#issuecomment-4237110063)
from @mitchellh.

Vouch: @0xDVC

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-04-13 14:23:27 +00:00
Mitchell Hashimoto
4f36896ddb macOS: add bottom bar when child exits (#12251)
### Closes #7649

The bar lives alongside URL Hover in VStack at the bottom. The current
body of SurfaceView is becoming rather long and complicated, so this pr
also contains some refactors:

- Move URL Hover to a separate file

> The text is copied from previous input string to keep it consistent,
also I’m confused with text on GTK so this is my first choice, but it
can be changed as the same as GTK.

Separate prs will be opened for:
1. Set to Read-only after exits
2. Hide cursor when in Read-only

### Preview


https://github.com/user-attachments/assets/eb44e211-eac5-4f40-836c-4912b18dfb01
2026-04-13 06:47:47 -07:00
Mitchell Hashimoto
4699a3f795 macOS: Command palette highlight matches (#12264)
- Highlight matching text in command palette search results
- Support initials matching
- Trim query before filtering commands

### AI Disclosure

Claude wrote most of it. I tested and reviewed it myself.

<img width="1544" height="297" alt="image"
src="https://github.com/user-attachments/assets/6ed98538-d6d3-48a0-8bb0-ac705611d058"
/>
2026-04-13 06:44:27 -07:00
Mitchell Hashimoto
ec434ec096 zon2nix: update to a version that is compatible with Zig 0.16 (#12259)
The `zon2nix` binary is now compiled with Zig 0.16, but it still
produces Zig 0.15 compatible output (in fact the output is identical to
previous versions).
2026-04-13 06:43:44 -07:00
Mitchell Hashimoto
fab8777931 core: implement backarrow key mode (DECBKM) - mode 67 (#12226)
This mode allows programs to modify the code that the `backspace` key
(backarrow key in DEC parlance) sends. If this mode is
`off`/`false`/`reset` (the default, the same as before this PR), we send
the byte `0x7f`. If this mode is `on`/`true`/`set` we send the byte
`0x08`.

<img width="659" height="715" alt="Screenshot From 2026-04-09 11-00-25"
src="https://github.com/user-attachments/assets/4f3e14ac-757d-4bb2-9fc5-b17019ad35d5"
/>
2026-04-13 06:43:30 -07:00
Lukas
073dd8a399 macOS: trim query before filtering commands 2026-04-13 12:47:48 +02:00
Lukas
2e169c42e8 macOS: Support initials matching in command palette search
Extend String.matchedIndices(for:) to fall back to initials
matching when no substring match is found. Typing the first letter
of each word now matches commands, e.g. "tbo" matches "Toggle
Background Opacity", with each matched initial highlighted.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 12:47:47 +02:00
Lukas
2bdc6bb1f7 macOS: Highlight matching text in command palette search results
Add String.matchedIndices(for:) to find substring matches and use
it to bold and tint matched characters with the accent color in
both titles and subtitles. Title matches take priority — subtitles
are only highlighted when the title didn't match.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 12:47:47 +02:00