diff options
| author | Can Celik <ogulcancelik@gmail.com> | 2026-09-10 21:51:57 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-10 21:51:57 +0300 |
| commit | 425c86179791cd32e2d4ce0ae7f269940b4b0663 (patch) | |
| tree | e52c4383a6d69216cbe2a32638bf90841d7e2189 /vendor/libghostty-vt.patches.md | |
| parent | 90e947a6e26e02f10ec7f1694c4eb5b78a86406b (diff) | |
chore: upgrade libghostty and preserve terminal behavior (#3906)
Diffstat (limited to 'vendor/libghostty-vt.patches.md')
| -rw-r--r-- | vendor/libghostty-vt.patches.md | 78 |
1 files changed, 46 insertions, 32 deletions
diff --git a/vendor/libghostty-vt.patches.md b/vendor/libghostty-vt.patches.md index dff98533..40645acc 100644 --- a/vendor/libghostty-vt.patches.md +++ b/vendor/libghostty-vt.patches.md @@ -4,74 +4,88 @@ This file tracks intentional local changes applied on top of the vendored `libghostty-vt` source. Remove a patch only when the vendored source commit contains the upstream behavior and the listed verification still passes. -## 0001 default lib-vt panes to grapheme clustering +## 0002 expose modifyOtherKeys mode through terminal data status: active -patch: `vendor/patches/libghostty-vt/0001-default-grapheme-cluster-mode.patch` +patch: `vendor/patches/libghostty-vt/0002-expose-modify-other-keys-mode.patch` -herdr issue: https://github.com/herdrdev/herdr/issues/243 +herdr issue: none; fixes the performance regression exposed by +https://github.com/herdrdev/herdr/pull/2303 -upstream discussion: not opened; libghostty-vt currently exposes current mode mutation but no C API for configuring terminal default modes +upstream discussion: not opened upstream pr: not opened -vendored base: `c5a21edfcbc2d5b46540ad91b7980aca31f5f1f3` +vendored base: `44f2a44df7e8c4a0c6df3f7d872ef3d7ead88e51` local files: +- `vendor/libghostty-vt/include/ghostty/vt/terminal.h` - `vendor/libghostty-vt/src/terminal/c/terminal.zig` -reason: Herdr renders terminal cells directly and requires DEC private mode -2027 to store flags, ZWJ emoji, and other multi-codepoint grapheme clusters in -one cell. This patch makes clustering active for new terminals and keeps it as -the reset default so RIS (`ESC c`) does not disable it. +reason: Herdr must know whether xterm modifyOtherKeys mode 2 is active to +request printable key releases from the outer terminal. The formatter API can +recover this fact only by formatting the active screen and scrollback. A typed +terminal-data query exposes the authoritative scalar without formatting or +allocation. The local query uses value 41; upstream now owns the previous +local value 33 for VT processing errors. -remove when: libghostty-vt exposes a C API for setting default mode 2027, or -upstream makes grapheme clustering the lib-vt default, and the reset-survival -regression passes without this patch. +remove when: the vendored source exposes an equivalent scalar query for +modifyOtherKeys mode 2 and Herdr can use it without this patch. verification: ```sh -cargo nextest run --locked grapheme_cluster_mode_is_default_and_survives_full_reset -cargo nextest run --locked grapheme_cluster_mode_renders_flag_emoji_in_single_wide_cell -cargo nextest run --locked grapheme_cluster_mode_renders_zwj_family_in_single_wide_cell +just test-one modify_other_keys +just test-one host_report_all_supplies_printable_releases_for_event_type_only_panes +just maintenance-test +just ui-hot-path-architecture-test ``` -## 0002 expose modifyOtherKeys mode through terminal data +The former grapheme-default patch is replaced by upstream's public +`GHOSTTY_TERMINAL_OPT_MODE_DEFAULT` API. Herdr configures mode 2027 through that +API and tests that RIS restores it after a child disables it. The Wuffs C-only +mirror fix from Ghostty PR 13789 is also included in this vendored base. + +## 0004 fix hosted Wuffs builds status: active -patch: `vendor/patches/libghostty-vt/0002-expose-modify-other-keys-mode.patch` +patch: `vendor/patches/libghostty-vt/0004-fix-hosted-wuffs-builds.patch` -herdr issue: none; fixes the performance regression exposed by -https://github.com/herdrdev/herdr/pull/2303 +herdr issue: none; preserves Windows cross-compilation and non-SIMD hosted builds upstream discussion: not opened upstream pr: not opened -vendored base: `c5a21edfcbc2d5b46540ad91b7980aca31f5f1f3` +vendored base: `44f2a44df7e8c4a0c6df3f7d872ef3d7ead88e51` local files: -- `vendor/libghostty-vt/include/ghostty/vt/terminal.h` -- `vendor/libghostty-vt/src/terminal/c/terminal.zig` +- `vendor/libghostty-vt/pkg/wuffs/build.zig` +- `vendor/libghostty-vt/pkg/wuffs/src/main.zig` -reason: Herdr must know whether xterm modifyOtherKeys mode 2 is active to -request printable key releases from the outer terminal. The formatter API can -recover this fact only by formatting the active screen and scrollback. A typed -terminal-data query exposes the authoritative scalar without formatting or -allocation. +reason: Wuffs now needs MSVC libc headers when targeting Windows. Zig's +`--libc` configuration reaches C compilation, but the translate-c dependency +requires its own explicit configuration. Forward the same file so cross-builds +can use an actual Windows SDK instead of changing the target ABI or skipping +compilation. Native builds without a libc override are unchanged. -remove when: the vendored source exposes an equivalent scalar query for -modifyOtherKeys mode 2 and Herdr can use it without this patch. +The no-libc Wuffs module also exports hidden weak calloc/free stubs. On hosted +Linux with SIMD disabled, those definitions override the Rust executable's +libc allocator, causing immediate allocation failures. Limit the stubs to +freestanding targets; hosted embedders resolve these symbols through libc. + +remove when: upstream forwards the build's libc configuration to the Wuffs +translator and prevents hosted allocator interposition, and both Windows +cross-compilation and non-SIMD native tests pass without this patch. verification: ```sh -cargo nextest run --locked modify_other_keys_query_tracks_mode_two -cargo nextest run --locked host_report_all_supplies_printable_releases_for_event_type_only_panes -python3 -m unittest scripts.test_vendor_libghostty_vt scripts.test_ui_hot_path_architecture +LIBGHOSTTY_VT_WINDOWS_LIBC=/path/to/windows-libc.txt just windows-lint +LIBGHOSTTY_VT_SIMD=false just test-one ghostty +just maintenance-test ``` |
