Commit Graph

17347 Commits

Author SHA1 Message Date
Mitchell Hashimoto
0073976231 terminal: preserve pending wrap in VT formatter (#13876)
Previously, formatting a cursor at the right edge emitted CUP, which
cleared pending wrap. Replayed output then overwrote the edge cell
instead of wrapping before the next printable character.

When pending wrap is set, move to and reformat the final cell to restore
the flag through normal VT behavior. Emit cursor pen state afterward and
cover replay plus pin-map behavior with a regression test.
2026-08-17 10:00:46 -07:00
Mitchell Hashimoto
997a2aff2a terminal: preserve pending wrap in VT formatter
Previously, formatting a cursor at the right edge emitted CUP, which
cleared pending wrap. Replayed output then overwrote the edge cell
instead of wrapping before the next printable character.

When pending wrap is set, move to and reformat the final cell to restore
the flag through normal VT behavior. Emit cursor pen state afterward and
cover replay plus pin-map behavior with a regression test.
2026-08-17 09:52:14 -07:00
Jon Parise
5c952ac977 macos: simplify command palette sort keys
Store the Comparable ObjectIdentifier directly instead of wrapping the
only sort key type in AnySortKey.

The expected deterministic ordering of equal terminal command titles is
also now verified by a unit test.
2026-08-17 12:50:27 -04:00
Mitchell Hashimoto
ee57b94170 libghostty: C api to stream formatter output through a GhosttyWriter (#13875)
Add `ghostty_formatter_format` which uses a streaming GhosttyWriter type
to write. Update the example to show this.
2026-08-17 09:42:04 -07:00
Mitchell Hashimoto
faaf07e7c0 macos: remove unused hosting window helper (#13873)
Remove the unused SwiftUI environment key intended to expose a hosting
window. Nothing sets or reads the value.
2026-08-17 09:36:11 -07:00
Mitchell Hashimoto
0baa0fd545 inspector: remove obsolete detachable header helper (#13874)
Remove the unused, callback-based detachable header implementation. It
supported the previous terminal inspector, which has since been deleted
(fdbe4343c). The current inspector uses DetachableHeader directly.
2026-08-17 09:36:02 -07:00
Mitchell Hashimoto
924c8a90de libghostty: C api to stream formatter output through a GhosttyWriter
Add `ghostty_formatter_format` which uses a streaming GhosttyWriter
type to write. Update the example to show this.
2026-08-17 09:34:52 -07:00
Mitchell Hashimoto
c8980b853b macos: don't put 0x7F as text in key event (#13871)
Fixes #13869

We already checked `< 0x20` but missed `0x7F` which causes similar
problems.
2026-08-17 09:21:39 -07:00
Jon Parise
d19f8f7f9d macos: remove unused hosting window helper
Remove the unused SwiftUI environment key intended to expose a hosting
window. Nothing sets or reads the value.
2026-08-17 10:58:41 -04:00
Jon Parise
2349e974b8 inspector: remove obsolete detachable header helper
Remove the unused, callback-based detachable header implementation. It
supported the previous terminal inspector, which has since been deleted
(fdbe4343c). The current inspector uses DetachableHeader directly.
2026-08-17 10:49:24 -04:00
trag1c
6c30dc1bff i18n: Update ko_KR translations (#13815)
Update all missing Korean translations for 1.4.

Part of #13766
2026-08-17 15:48:41 +02:00
Mitchell Hashimoto
f4309055fb macos: don't put 0x7F as text in key event
Fixes #13869

We already checked `< 0x20` but missed `0x7F` which causes similar
problems.
2026-08-17 06:44:16 -07:00
ghostty-vouch[bot]
3924a32556 Update VOUCHED list (#13870)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/13838#discussioncomment-18052745)
from @mitchellh.

Vouch: @basteez

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-17 13:22:13 +00:00
trag1c
b97b17f06b i18n: translate v1.4 strings (be) (#13771)
Continues the Belarusian (`be`) translation for v1.4 per #13766.
Translates the remaining 181 strings (mostly the newly-localized command
palette), bringing `be` to 253/253.
2026-08-17 09:13:53 +02:00
Mitchell Hashimoto
e9db8d2b0b libghostty: use custom memory pool for Wasm, reduce terminal memory by ~75% (#13865)
A custom memory pool for Wasm that grows by exactly one item size per
growth and shares the pool across the entire Wasm-module instead of
per-terminal.

Some background on why `std.heap.MemoryPool` is considered harmful for
WebAssembly:

First, the std.heap.MemoryPool grows 1.5x at each growth point. The
backing allocator for that is usually a GPA which is the BrkAllocator
for wasm. This grows by power-of-two big-allocation slots. If you pair
these together you get a massive permanent linear memory growth.

On non-wasm targets, the memory growth doesn't matter because these are
virtual memory mappings that don't cost physical memory, but wasm
doesn't work that way. Also on native targets, the syscalls to allocate
memory are very expensive (relatively), so it makes sense to allocate
large virtual memory chunks and avoid them. Again, wasm doesn't work
this way.

Second, we were using one pool per terminal. On wasm, this meant that we
paid for the free list N times. On non-wasm, this makes sense because
the synchronization overhead has so far been measurable enough under
load to be prohibitive (although, I'm still skeptical about this and
want to look into it). On wasm, we build single-threaded modules, so we
can use a global free list without any extra overhead.

## Benchmarks

80x24 terminal with 1000-line scrollack processing 16MB of plain ASCII.

| Scenario                        |    Before |     After |
| ------------------------------- | --------: | --------: |
| Fresh instance                  |  0.56 MiB |  0.56 MiB |
| First `terminal_new` (delta)    | +3.44 MiB | +0.88 MiB |
| One filled terminal (total)     |  4.00 MiB |  1.88 MiB |
| Each additional filled terminal | +3.00 MiB | +0.44 MiB |
| 5 filled terminals (total)      | 16.00 MiB |  4.06 MiB |

Throughput numbers are unchanged on wasm and native (to be expected in
the latter because this is all gated on
wasm).

Note I'm still very much optimizing the above numbers! This is just my
first big win.

**AI usage:** None used except to validate and judge.
2026-08-16 21:12:59 -07:00
Mitchell Hashimoto
492c26067c libghostty: use custom memory pool for Wasm
A custom memory pool for Wasm that grows by exactly one item size per
growth and shares the pool across the entire Wasm-module instead of 
per-terminal.

Some background on why `std.heap.MemoryPool` is considered harmful for 
WebAssembly:

First, the std.heap.MemoryPool grows 1.5x at each growth point. The backing 
allocator for that is usually a GPA which is the BrkAllocator for wasm. 
This grows by power-of-two big-allocation slots. If you pair these together 
you get a massive permanent linear memory growth. On non-wasm targets,
this doesn't matter because these are virtual memory mappings that don't
cost physical memory, but wasm doesn't work that way.

Second, we were using one pool per terminal. On wasm, this meant that 
we paid for the free list N times. On non-wasm, this makes sense because
the synchronization overhead has so far been measurable enough under
load to be prohibitive (although, I'm still skeptical about this and want
to look into it). On wasm, we build single-threaded modules, so we can use
a global free list without any extra overhead.

## Benchmarks

80x24 terminal with 1000-line scrollack processing 16MB of plain ASCII.

| Scenario                        |    Before |     After |
| ------------------------------- | --------: | --------: |
| Fresh instance                  |  0.56 MiB |  0.56 MiB |
| First `terminal_new` (delta)    | +3.44 MiB | +0.88 MiB |
| One filled terminal (total)     |  4.00 MiB |  1.88 MiB |
| Each additional filled terminal | +3.00 MiB | +0.44 MiB |
| 5 filled terminals (total)      | 16.00 MiB |  4.06 MiB |

Throughput numbers are unchanged on wasm and native (to be expected in
the latter because this is all gated on wasm).
2026-08-16 20:55:09 -07:00
Mitchell Hashimoto
8d70c5dca0 libghostty: reduce Wasm stack reservation (#13864)
Zig default's Wasm stacks to 1MB. Change it to 128 KB instead.

This removes 896 KiB from every Wasm instance's initial linear memory
reservation. That means that simply _loading_ `ghostty-vt.wasm` is down
this much.

Through various workload benchmarks of real terminal snapshots,
artificial worst case full ascii, full styled, full emoji, full mixed,
etc. workloads, I wasn't able to get a stack to go above 17 KB, so 128
KB is VERY generous. Lets start here.
2026-08-16 20:24:36 -07:00
Mitchell Hashimoto
5364e5158f libghostty: reduce Wasm stack reservation
Zig default's Wasm stacks to 1MB. Change it to 128 KB instead.

This removes 896 KiB from every Wasm instance's initial linear memory
reservation. That means that simply _loading_ `ghostty-vt.wasm` is down
this much.

Through various workload benchmarks of real terminal snapshots,
artificial worst case full ascii, full styled, full emoji, full mixed,
etc. workloads, I wasn't able to get a stack to go above 17 KB, so 128 KB
is VERY generous. Lets start here.
2026-08-16 19:42:24 -07:00
Jeffrey C. Ollie
9a770be61c build(deps): bump cachix/install-nix-action from 31.11.0 to 31.11.1 (#13863)
Bumps
[cachix/install-nix-action](https://github.com/cachix/install-nix-action)
from 31.11.0 to 31.11.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/cachix/install-nix-action/releases">cachix/install-nix-action's
releases</a>.</em></p>
<blockquote>
<h2>v31.11.1</h2>
<h2>What's Changed</h2>
<ul>
<li>nix: 2.35.1 -&gt; 2.35.2 by <a
href="https://github.com/github-actions"><code>@​github-actions</code></a>[bot]
in <a
href="https://redirect.github.com/cachix/install-nix-action/pull/281">cachix/install-nix-action#281</a>
Fixes a crash (<a
href="https://redirect.github.com/NixOS/nix/issues/16005"><code>Assertion
'!awake.empty()' failed</code></a>) that could abort builds.</li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/cachix/install-nix-action/compare/v31.11.0...v31.11.1">https://github.com/cachix/install-nix-action/compare/v31.11.0...v31.11.1</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="13d8dd58da"><code>13d8dd5</code></a>
fix(ci): skip latest installer on x86_64-darwin</li>
<li><a
href="875018fe55"><code>875018f</code></a>
Merge pull request <a
href="https://redirect.github.com/cachix/install-nix-action/issues/281">#281</a>
from cachix/create-pull-request/patch</li>
<li><a
href="6624a11f6c"><code>6624a11</code></a>
nix: 2.35.1 -&gt; 2.35.2</li>
<li>See full diff in <a
href="630ae543ea...13d8dd58da">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=cachix/install-nix-action&package-manager=github_actions&previous-version=31.11.0&new-version=31.11.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>
2026-08-16 19:49:04 -05:00
dependabot[bot]
7a966438fc build(deps): bump cachix/install-nix-action from 31.11.0 to 31.11.1
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 31.11.0 to 31.11.1.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Changelog](https://github.com/cachix/install-nix-action/blob/master/RELEASE.md)
- [Commits](630ae543ea...13d8dd58da)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-version: 31.11.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-17 00:16:28 +00:00
Ilia Kravchenko
820ed688ef i18n(be): fix translation issues per review
- Drop redundant 'было' copula with short-form participles (lines 1767, 1769)
- Use short predicative form 'недаступна' (line 1780)
- 'у двух фарматах:' instead of dash-construction (line 156)
- 'Аднавіць' instead of 'Паўтарыць' for Redo (semantic pair with Undo)
- Fix 'у' → 'ў' after 'ANSI' (7 places)
- Align label/description wording for Split Zoom, Read-Only, Float on Top, Secure Input
- 'усе акны' instead of 'усе вокны' (consistent with 'акно')
- 'калі яна ёсць' instead of 'даступная' (if present ≠ available)
- Infinitive 'Дадаць' instead of imperative 'Дадайце'
2026-08-16 20:33:57 -03:00
Guilherme Nandi Tiscoski
bde2047a63 Apply suggestions from code review
Co-authored-by: Micael Jarniac <micael@jarniac.com>
2026-08-16 17:15:09 -05:00
Guilherme Nandi Tiscoski
132f154e5f Update po/pt_BR.po
Co-authored-by: Micael Jarniac <micael@jarniac.com>
2026-08-16 17:13:20 -05:00
Guilherme Nandi Tiscoski
3bdbad7d88 Update po/pt_BR.po
Co-authored-by: Micael Jarniac <micael@jarniac.com>
2026-08-16 17:12:56 -05:00
Guilherme Nandi Tiscoski
03cb485f60 Update po/pt_BR.po
Co-authored-by: Micael Jarniac <micael@jarniac.com>
2026-08-16 17:12:45 -05:00
Guilherme Nandi Tiscoski
e820ef48b2 Update po/pt_BR.po
Co-authored-by: Micael Jarniac <micael@jarniac.com>
2026-08-16 17:12:32 -05:00
Guilherme Nandi Tiscoski
e493926713 Update po/pt_BR.po
Co-authored-by: Micael Jarniac <micael@jarniac.com>
2026-08-16 17:10:53 -05:00
Guilherme Nandi Tiscoski
ed13a09a59 Update po/pt_BR.po
Co-authored-by: Micael Jarniac <micael@jarniac.com>
2026-08-16 17:10:25 -05:00
Guilherme Nandi Tiscoski
cdefb6809a Update po/pt_BR.po
Co-authored-by: Micael Jarniac <micael@jarniac.com>
2026-08-16 17:09:45 -05:00
Guilherme Nandi Tiscoski
be892fc6c1 Update po/pt_BR.po
Co-authored-by: Micael Jarniac <micael@jarniac.com>
2026-08-16 17:09:27 -05:00
Guilherme Nandi Tiscoski
17a66279be Update po/pt_BR.po
Co-authored-by: Micael Jarniac <micael@jarniac.com>
2026-08-16 17:07:57 -05:00
Guilherme Nandi Tiscoski
0149ef5f72 Update po/pt_BR.po
Co-authored-by: Micael Jarniac <micael@jarniac.com>
2026-08-16 17:07:49 -05:00
Guilherme Nandi Tiscoski
58c4796c1c Update po/pt_BR.po
Co-authored-by: Micael Jarniac <micael@jarniac.com>
2026-08-16 17:07:32 -05:00
Guilherme Nandi Tiscoski
1b8da6b40f Update po/pt_BR.po
Co-authored-by: Micael Jarniac <micael@jarniac.com>
2026-08-16 17:07:25 -05:00
Guilherme Nandi Tiscoski
31a10a7b51 Update po/pt_BR.po
Co-authored-by: Micael Jarniac <micael@jarniac.com>
2026-08-16 17:07:19 -05:00
Guilherme Nandi Tiscoski
1225632d1c Update po/pt_BR.po
Co-authored-by: Micael Jarniac <micael@jarniac.com>
2026-08-16 17:07:13 -05:00
Guilherme Nandi Tiscoski
6fe197d86a Update po/pt_BR.po
Co-authored-by: Micael Jarniac <micael@jarniac.com>
2026-08-16 17:07:06 -05:00
Guilherme Nandi Tiscoski
d6871cd924 Update po/pt_BR.po
Co-authored-by: Micael Jarniac <micael@jarniac.com>
2026-08-16 17:06:51 -05:00
Guilherme Nandi Tiscoski
6c29a0a282 Update po/pt_BR.po
Co-authored-by: Micael Jarniac <micael@jarniac.com>
2026-08-16 17:06:45 -05:00
Guilherme Nandi Tiscoski
1c34e0df85 Update po/pt_BR.po
Co-authored-by: Micael Jarniac <micael@jarniac.com>
2026-08-16 17:06:38 -05:00
Guilherme Nandi Tiscoski
123dc0ccb1 Update po/pt_BR.po
Co-authored-by: Micael Jarniac <micael@jarniac.com>
2026-08-16 17:06:31 -05:00
Guilherme Nandi Tiscoski
6ab3ef9471 Update po/pt_BR.po
Co-authored-by: Micael Jarniac <micael@jarniac.com>
2026-08-16 17:05:10 -05:00
Jeffrey C. Ollie
602497e9b9 input: skip text fallback for kitty key releases (#13861)
Key events without a kitty entry fall back to writing their UTF-8 text
directly. On GTK, keys whose unshifted keysym is a dead key or level 5
latch have no unshifted codepoint and take this path. With event type
reporting enabled, releases therefore emitted the same text as presses
and duplicated characters in applications such as Neovim.

Skip the raw text fallback for release events while retaining it for
presses and repeats. Keep the guard in the shared encoder so release
events for identified keys still retain the UTF-8 data used to derive
alternate keys.

Cover releases with and without report-all mode, and verify that repeat
events continue to emit fallback text.

  - https://github.com/ghostty-org/ghostty/discussions/12192
  - https://github.com/ghostty-org/ghostty/discussions/12084
  - https://github.com/ghostty-org/ghostty/discussions/12433
  - https://github.com/ghostty-org/ghostty/discussions/13816

## Testing

  - `zig build test-lib-vt -Dtarget=x86_64-linux-gnu`
  - `zig build -Demit-lib-vt -Dtarget=x86_64-linux-gnu`
  - `zig build`
  - Verified the regression test fails without the release guard
- Manually tested the GTK backend under Wayland/Sway and X11/XWayland,
with the GTK simple input context and ibus 1.5.34:
    - Ergo-L `!` and `'`
    - Spanish `[`, `{`, `]`, and `}`
- Presses, repeats, and both modifier-release orders in `nvim --clean`
    - Dead-key composition and cancellation
    - Unicode hexadecimal input
- Full kitty keyboard mode with `kitty +kitten show_key -m kitty`,
including composed text

## AI disclosure

OpenAI Codex assisted with investigating the reports, reviewing the GTK
and kitty input paths, extending the regression tests, running
validation, and drafting this description. I reviewed the final code,
edited this description, manually performed the tests listed above, and
understand how the change interacts with the input encoder.
2026-08-16 16:32:35 -05:00
Mitchell Hashimoto
f8856a78a2 config: preserve bytes in hex escapes (#13862)
Fixes #13855

Make the config string parser preserve hexadecimal escapes as bytes.
Previously all escaped values were encoded as Unicode codepoints.
2026-08-16 14:23:09 -07:00
Mitchell Hashimoto
29b82dd80c config: preserve bytes in hex escapes
Fixes #13855

Make the config string parser preserve hexadecimal escapes as bytes.
Previously all escaped values were encoded as Unicode codepoints.
2026-08-16 14:14:26 -07:00
Jeffrey C. Ollie
7557944b4f feat: expand tildes in config theme path to HOME (#13840)
When loading a theme from a path that includes a tilde:
```
theme="~/.cache/wal/colors-ghostty"
```
ghostty currently fails with the following error:
```
cannot include path separators unless it is an absolute path
```

This PR tries to expand the ~ of the path. If there is no ~ or expansion
fails, it falls back to the unexpanded value.
2026-08-16 15:19:16 -05:00
Mitchell Hashimoto
3790fb78fe libghostty: simplify Wasm allocation API (#13860)
Replace a bunch of type-specific Wasm allocation functions with a
generic byte allocator and reusable opaque out-parameters for pointers.
This makes it a lot more ergonomic (relatively) to use the Wasm
interface and removes a dozen or so exports.

This also updates the `ghostty_type_json` `abi` field with a maximum
alignment value that host sides can use to keep every allocation aligned
properly, easily, without hardcoding numbers.

This adds a test to verify this all works as intended and runs in CI.
2026-08-16 12:44:01 -07:00
Mitchell Hashimoto
a8e9b413f1 libghostty: simplify Wasm allocation API
Replace a bunch of type-specific Wasm allocation functions with a generic
byte allocator and reusable opaque out-parameters for pointers. This
makes it a lot more ergonomic (relatively) to use the Wasm interface
and removes a dozen or so exports.

This also updates the `ghostty_type_json` `abi` field with a maximum
alignment value that host sides can use to keep every allocation aligned
properly, easily, without hardcoding numbers.

This adds a test to verify this all works as intended and runs in CI.
2026-08-16 12:39:51 -07:00
ghostty-vouch[bot]
7b57c0a029 Update VOUCHED list (#13859)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/13858#discussioncomment-18043290)
from @jcollie.

Vouch: @tsacha

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-16 19:25:55 +00:00
Sacha Trémoureux
bd647035e9 input: don't emit fallback text on key release
Key events without a kitty entry fall back to writing their UTF-8 text
directly. On GTK, keys whose unshifted keysym is a dead key or level 5
latch have no unshifted codepoint and take this path. With event type
reporting enabled, releases therefore emitted the same text as presses
and duplicated characters in applications such as Neovim.

Skip the raw text fallback for release events while retaining it for
presses and repeats. Keep the guard in the shared encoder so release
events for identified keys still retain the UTF-8 data used to derive
alternate keys.

Cover releases with and without report-all mode, and verify that repeat
events continue to emit fallback text.
2026-08-16 20:42:19 +02:00