Commit Graph

17352 Commits

Author SHA1 Message Date
Kris
fc5ac17a68 i18n: complete Dutch (nl) translation for v1.4 (#13853)
Fills the 181 untranslated strings in `po/nl.po`, bringing it to
252/252. Most of them are the command palette actions from
`src/input/command.zig`; the rest are the new context menu items, global
keybind notifications, and config editing strings.

**Style.** Ten of the new command palette strings had already been
translated by previous translators, and those settle the verb form, so
the rest follows them: imperative for verb+object action titles (`Split
Left` → `Splits naar links`, `Close Tab` → `Sluit tabblad`), noun
phrases left as noun phrases (`New Window` → `Nieuw venster`), no title
case, informal "je". Descriptions are full imperative sentences. Dialog
headings keep the noun-first infinitive form of the existing `Change
Terminal Title` → `Titel van de terminal wijzigen`.

A few translation notes:

- `ANSI Sequences` → `ANSI-reeksen` in titles, `ANSI escape sequences` →
`ANSI-escapereeksen` in descriptions, mirroring the distinction the
source makes.
- `Toggle X` titles use the idiomatic `X aan/uit`; their descriptions
stay imperative (`Schakel … in of uit.`).
- `surface` is rendered as `terminal` - the Dutch UI has no equivalent
concept.
- `scrollback` → `scrollbuffer`.

**No existing translation was modified.** The diff only touches empty
`msgstr` lines plus `PO-Revision-Date` and `Last-Translator`.

Checked with `msgfmt -c --statistics` (252 translated, no warnings, no
fuzzy) and `msgcat` (formatting is idempotent, so no rewrap noise for
the next translator). No `X-Generator` field added.

---------

Co-authored-by: Nico Geesink <126799020+nwehg@users.noreply.github.com>
2026-08-20 01:43:41 +00:00
Mitchell Hashimoto
9154efcbd3 macos: avoid temporary path component allocation (#13921)
The common directory helper previously allocated a temporary slice to
prepend the base directory before joining path components. Pass the
three known components directly to std.fs.path.join, leaving only the
allocation for the returned path.
2026-08-19 17:04:55 -07:00
Jon Parise
a436a9edcc macos: avoid temporary path component allocation
The common directory helper previously allocated a temporary slice to
prepend the base directory before joining path components. Pass the
three known components directly to std.fs.path.join, leaving only the
allocation for the returned path.
2026-08-19 19:31:18 -04:00
Mitchell Hashimoto
50d3ac8ed6 shell-integration: avoid owning temporary commands (#13919)
Some shell setup functions previously converted their stack-backed
command builders to owned sentinel slices before duplicating them into
the result arena. Duplicate the builders' written bytes directly
instead, avoiding unnecessary ownership transfer and sentinel handling.
2026-08-19 15:18:05 -07:00
Mitchell Hashimoto
49e503fd40 surface: parse text bindings with stack fallback (#13918)
Text binding actions previously allocated a temporary buffer for every
escaped string. Use a 256-byte stack fallback allocator so typical
bindings avoid the transient heap allocation while larger values
continue to use the existing heap-backed behavior.
2026-08-19 15:09:45 -07:00
Jon Parise
8e8d76b634 shell-integration: avoid owning temporary commands
Some shell setup functions previously converted their stack-backed
command builders to owned sentinel slices before duplicating them into
the result arena. Duplicate the builders' written bytes directly
instead, avoiding unnecessary ownership transfer and sentinel handling.
2026-08-19 17:46:14 -04:00
Jon Parise
a9f7f6d212 surface: parse text bindings with stack fallback
Text binding actions previously allocated a temporary buffer for every
escaped string. Use a 256-byte stack fallback allocator so typical
bindings avoid the transient heap allocation while larger values
continue to use the existing heap-backed behavior.
2026-08-19 17:36:43 -04:00
Mitchell Hashimoto
a4edca2a90 surface: keep clipboard content list on stack (#13916)
Use a two element stack-based buffer for the one or two ClipboardContent
entries rather than the (arena-based) heap allocator.
2026-08-19 14:19:56 -07:00
Mitchell Hashimoto
4d646bae0c macOS: group settings menu in a separate group (#13906)
**Reverted https://github.com/ghostty-org/ghostty/pull/13664 with a
second thought.**

This keeps the consistency with other first-party apps like Terminal,
Finder, and Music. It seems that most of the first-party apps show the
standard icons on macOS 27 for "Settings...", "Find", "AutoFill" and
etc., but in a separate group.

<img width="1060" height="375" alt="image"
src="https://github.com/user-attachments/assets/d3017865-a443-4c14-ace9-1c6b5acb3f56"
/>


I believe this still follows
[HIG](https://developer.apple.com/design/human-interface-guidelines/menus#Icons).
2026-08-19 14:11:28 -07:00
Jon Parise
5a8921ecb5 surface: keep clipboard content list on stack
Use a two element stack-based buffer for the one or two ClipboardContent
entries rather than the (arena-based) heap allocator.
2026-08-19 17:06:14 -04:00
trag1c
3e7230bf5d i18n: update pt_BR translations (#13819)
Update all missing Portuguese/BR translations for 1.4.

Part of https://github.com/ghostty-org/ghostty/issues/13766
2026-08-19 22:01:27 +02:00
Guilherme Tiscoski
959c0daeaa i18n: update revision date 2026-08-19 13:44:25 -05:00
Guilherme Tiscoski
e8a7097f65 i18: use "aplicativo" instead of "aplicação" for "application" 2026-08-19 11:57:49 -05:00
Guilherme Nandi Tiscoski
5a55a345aa Update po/pt_BR.po
Co-authored-by: Micael Jarniac <micael@jarniac.com>
2026-08-19 11:52:13 -05:00
Guilherme Nandi Tiscoski
4302020990 Update po/pt_BR.po
Co-authored-by: Micael Jarniac <micael@jarniac.com>
2026-08-19 11:52:04 -05:00
Guilherme Nandi Tiscoski
9581f7dd45 Update po/pt_BR.po
Co-authored-by: Micael Jarniac <micael@jarniac.com>
2026-08-19 11:51:56 -05:00
Guilherme Nandi Tiscoski
65621664ed Update po/pt_BR.po
Co-authored-by: Micael Jarniac <micael@jarniac.com>
2026-08-19 11:51:44 -05:00
Guilherme Nandi Tiscoski
ae7080e6cc Update po/pt_BR.po
Co-authored-by: Micael Jarniac <micael@jarniac.com>
2026-08-19 11:51:31 -05:00
Mitchell Hashimoto
d9ffbbf17c chore(vt): expose snapshot api (#13912)
Link:
https://discord.com/channels/1005603569187160125/1420009803173859449/1539649787748417667
2026-08-19 08:32:12 -07:00
Lukas
043abc7b60 macOS: group settings menu in a separate group 2026-08-19 15:03:15 +02:00
Lukas
f6990690f0 Revert "macOS: hide settings menu icon on macOS 27 (#13664)"
This reverts commit 99c483f477, reversing
changes made to 33bdeed1cb.
2026-08-19 15:02:01 +02:00
Mitchell Hashimoto
4c6215bb8e terminal: clear tabstop bit on unset instead of toggling (#13900)
Make `Tabstops.unset` (backing [Tab Clear
(TBC)](https://ghostty.org/docs/vt/csi/tbc) with `n=0`) not set a tab
stop when clearing a column that has no tab stop.
2026-08-18 17:58:55 -07:00
Fredrik Fornwall
bed20eb364 terminal: clear tabstop bit on unset instead of toggling
Tabstops.unset used XOR, so unsetting a column without a tabstop set
one instead. This made TBC (CSI 0 g) and CTC (CSI 2 W) create a
tabstop at the cursor column when none existed.

Signed-off-by: Fredrik Fornwall <fredrik@fornwall.net>
2026-08-18 23:11:07 +02:00
Mitchell Hashimoto
7f62fe70a2 terminal/kitty: preserve data on unmatched delete (#13898)
Make uppercase Kitty graphics deletes with a nonzero placement ID leave
the image intact when the named placement does not exist.

Previously, d=I,i=...,p=... could free unreferenced image data after
matching no placement. A later put then failed with ENOENT, diverging
from the protocol and Kitty.
2026-08-18 12:20:45 -07:00
Mitchell Hashimoto
fe12e30b34 terminal/kitty: preserve chunked response identifiers (#13897)
Chunked image responses used the final command even though only the
initial chunk carries the image and placement identifiers. Successful
replies lost image numbers and placement IDs. Final validation errors
could also be suppressed entirely.

Save the initial response identifiers with the in-progress image and use
them when the final chunk completes. Continue replacing the response ID
with the generated image ID after a successful load. Cover successful
image-number replies and invalid final payloads with unit tests.
2026-08-18 12:20:04 -07:00
Mitchell Hashimoto
72b6cd7124 terminal/kitty: validate graphics query image data (#13896)
Graphics query commands previously initialized their loading state but
returned success before completing the image load.

This allowed truncated, malformed, or otherwise invalid image data to
return OK, giving capability probes a false positive.

Complete and validate queried images through the normal load path, then
discard the result without modifying image storage. Add coverage for
invalid data and preserving an existing image with the queried ID.
2026-08-18 12:19:03 -07:00
Mitchell Hashimoto
306a169033 terminal/kitty: preserve data on unmatched delete
Make uppercase Kitty graphics deletes with a nonzero placement ID
leave the image intact when the named placement does not exist.

Previously, d=I,i=...,p=... could free unreferenced image data after
matching no placement. A later put then failed with ENOENT, diverging
from the protocol and Kitty.
2026-08-18 12:12:35 -07:00
Mitchell Hashimoto
86d94f150a terminal/kitty: preserve chunked response identifiers
Chunked image responses used the final command even though only the
initial chunk carries the image and placement identifiers. Successful
replies lost image numbers and placement IDs. Final validation errors
could also be suppressed entirely.

Save the initial response identifiers with the in-progress image and use
them when the final chunk completes. Continue replacing the response ID
with the generated image ID after a successful load. Cover successful
image-number replies and invalid final payloads with unit tests.
2026-08-18 12:10:47 -07:00
Mitchell Hashimoto
cfc5a96501 terminal/kitty: validate graphics query image data
Graphics query commands previously initialized their loading state but
returned success before completing the image load.

This allowed truncated, malformed, or otherwise invalid image data to
return OK, giving capability probes a false positive.

Complete and validate queried images through the normal load path, then
discard the result without modifying image storage. Add coverage for
invalid data and preserving an existing image with the queried ID.
2026-08-18 12:08:02 -07:00
Mitchell Hashimoto
2ced1e5c8e terminal/kitty: fix various graphics deletion mismatches with spec (#13895)
- Limit d=a/A to non-virtual placements that intersect the active
screen.
- Keep unrelated unplaced image data when processing d=A.
- Make d=R delete matching unused images even when they have no
placements, and default an omitted x bound to zero.
- Give ED2 a separate clear path that preserves scrollback references
while reclaiming every unreferenced image.

References:
- Spec:
https://sw.kovidgoyal.net/kitty/graphics-protocol/#deleting-images
- Delete reference implementation:
0ecb10d158/kitty/graphics.c (L2114-L2363)
- ED2 reference implementation:
0ecb10d158/kitty/screen.c (L2919-L2958)
2026-08-18 11:39:10 -07:00
Mitchell Hashimoto
f8b40a0235 terminal/kitty: fix various graphics deletion mismatches with spec
- Limit d=a/A to non-virtual placements that intersect the active screen.
- Keep unrelated unplaced image data when processing d=A.
- Make d=R delete matching unused images even when they have no
  placements, and default an omitted x bound to zero.
- Give ED2 a separate clear path that preserves scrollback references
  while reclaiming every unreferenced image.

References:
- Spec:
  https://sw.kovidgoyal.net/kitty/graphics-protocol/#deleting-images
- Delete reference implementation:
  0ecb10d158/kitty/graphics.c (L2114-L2363)
- ED2 reference implementation:
  0ecb10d158/kitty/screen.c (L2919-L2958)
2026-08-18 11:29:20 -07:00
Mitchell Hashimoto
55dac8fc47 terminal/kitty: abort incomplete graphics loads (#13893)
Previously, delete left partial bytes alive for the next upload, while
failed or incomplete retransmissions kept stale placements visible.

Abort incomplete chunked image uploads on delete commands and remove an
existing image and its placements when retransmission of an explicit ID
begins.
2026-08-18 11:06:05 -07:00
Mitchell Hashimoto
e5747cf0b6 terminal/kitty: abort incomplete graphics loads
Previously, delete left partial bytes alive for the next upload, while
failed or incomplete retransmissions kept stale placements visible.

Abort incomplete chunked image uploads on delete commands and remove an
existing image and its placements when retransmission of an explicit ID
begins.
2026-08-18 10:56:13 -07:00
Mitchell Hashimoto
364f8e9ac1 terminal/kitty: graphics S value is exact byte, not max (#13892)
File transmissions with exactly S bytes or trailing file data previously
failed because appendRemaining reports StreamTooLong when it reaches its
limit. This broke the protocol's partial-file transmission path.

Use an exact-length allocation and read when S is nonzero, rejecting
premature EOF and values above the image limit. Preserve the existing
bounded read-to-EOF behavior for S=0.

https://sw.kovidgoyal.net/kitty/graphics-protocol/#local-client
2026-08-18 10:53:15 -07:00
Mitchell Hashimoto
abd77067de terminal/kitty: graphics S value is exact byte, not max
File transmissions with exactly S bytes or trailing file data previously
failed because appendRemaining reports StreamTooLong when it reaches its
limit. This broke the protocol's partial-file transmission path.

Use an exact-length allocation and read when S is nonzero, rejecting
premature EOF and values above the image limit. Preserve the existing
bounded read-to-EOF behavior for S=0.

https://sw.kovidgoyal.net/kitty/graphics-protocol/#local-client
2026-08-18 10:40:34 -07:00
Mitchell Hashimoto
7e5dfa09eb terminal/kitty: constrain placement offsets to cell bounds (#13891)
Clamp X and Y offsets when a placement is created and normalize them
again against current cell geometry when sizing and rendering. The
protocol requires offsets to remain within the first cell and not
enlarge explicit c/r rectangles:

https://sw.kovidgoyal.net/kitty/graphics-protocol/#controlling-displayed-image-layout

Previously, explicit placements were sized to the full c/r rectangle
before the offset was applied. This extended their far edge into
neighboring cells and let unbounded offsets reach renderer geometry.
2026-08-18 10:31:53 -07:00
Mitchell Hashimoto
c5a3c7e2e5 terminal/kitty: constrain placement offsets to cell bounds
Clamp X and Y offsets when a placement is created and normalize them
again against current cell geometry when sizing and rendering. The
protocol requires offsets to remain within the first cell and not
enlarge explicit c/r rectangles:
https://sw.kovidgoyal.net/kitty/graphics-protocol/#controlling-displayed-image-layout

Previously, explicit placements were sized to the full c/r rectangle
before the offset was applied. This extended their far edge into
neighboring cells and let unbounded offsets reach renderer geometry.
2026-08-18 10:28:03 -07:00
Mitchell Hashimoto
9848cb15fa terminal/kitty: intersect source rectangles before sizing (#13890)
Kitty graphics placements previously calculated pixel and grid geometry
from requested source dimensions before intersecting them with the
image. The renderer clamped explicit dimensions later but treated
omitted source dimensions as the full image.

This stretched clipped crops into incorrectly sized destinations and
exposed inconsistent geometry through storage, rendering, and
libghostty.

Resolve the source rectangle once against the image bounds and reuse it
for placement sizing, renderer preparation, and the C API. Add
regression tests for omitted and explicit dimensions and renderer
geometry.

Spec:
https://sw.kovidgoyal.net/kitty/graphics-protocol/#controlling-displayed-image-layout
Reference:
0ecb10d158/kitty/graphics.c (L1225-L1240)
2026-08-18 10:24:50 -07:00
Mitchell Hashimoto
409e682c83 terminal/kitty: reject conflicting image identifiers (#13889)
Reject Kitty graphics commands that specify both an image ID and an
image number across every protocol action.

These commands previously produced no wire response for transmissions,
while put and delete actions could proceed using one identifier and
mutate terminal state.

Retain the original command identifiers, validate them before action
dispatch, and preserve them in the EINVAL response. Add regression
coverage for every action, response encoding, quiet suppression, and
pre-mutation rejection.


https://sw.kovidgoyal.net/kitty/graphics-protocol/#requesting-image-ids-from-the-terminal
2026-08-18 10:24:42 -07:00
Mitchell Hashimoto
52190a5d8d terminal/kitty: intersect source rectangles before sizing
Kitty graphics placements previously calculated pixel and grid geometry
from requested source dimensions before intersecting them with the image.
The renderer clamped explicit dimensions later but treated omitted
source dimensions as the full image.

This stretched clipped crops into incorrectly sized destinations and
exposed inconsistent geometry through storage, rendering, and
libghostty.

Resolve the source rectangle once against the image bounds and reuse it
for placement sizing, renderer preparation, and the C API. Add
regression tests for omitted and explicit dimensions and renderer
geometry.

Spec: https://sw.kovidgoyal.net/kitty/graphics-protocol/#controlling-displayed-image-layout
Reference: 0ecb10d158/kitty/graphics.c (L1225-L1240)
2026-08-18 10:10:01 -07:00
Mitchell Hashimoto
83145c0a37 terminal/kitty: reject conflicting image identifiers
Reject Kitty graphics commands that specify both an image ID and an
image number across every protocol action.

These commands previously produced no wire response for transmissions,
while put and delete actions could proceed using one identifier and
mutate terminal state.

Retain the original command identifiers, validate them before action
dispatch, and preserve them in the EINVAL response. Add regression
coverage for every action, response encoding, quiet suppression, and
pre-mutation rejection.

https://sw.kovidgoyal.net/kitty/graphics-protocol/#requesting-image-ids-from-the-terminal
2026-08-18 10:07:20 -07:00
Mitchell Hashimoto
d4d72f3205 terminal/kitty: place cursor after tall images properly (#13887)
Supersedes #13886

This fixes an incompatibility between Ghostty and Kitty 0.47.1+.

Previously, Ghostty handled `C=0` by moving down at most one terminal
height and then clamping the horizontal destination to the screen. The
limit protected against an image command requesting billions of rows,
but it counted ordinary movement to the bottom as well as scrolling.

Kitty defines `C=0` as leaving the cursor after the image and implements
the movement as rows minus one, plus one row when the image reaches the
right edge:


https://sw.kovidgoyal.net/kitty/graphics-protocol/#controlling-displayed-image-layout
0ecb10d158/kitty/graphics.c (L1256-L1260)
0ecb10d158/kitty/screen.c (L1903-L1915)

(Had to view Kitty source to verify what the spec meant)

For example, an eight-row, full-width image in a five-row terminal needs
four moves to reach the bottom and four more to scroll. The old limit
allowed only five moves in total, so the next image started four rows
inside the first one. Clamping the horizontal destination also left the
cursor at the final column instead of wrapping to column one of the next
row. Consecutive images could therefore overlap in both directions.
2026-08-18 08:58:46 -07:00
Mitchell Hashimoto
afb61e1b62 terminal/kitty: place cursor after tall images properly
Supersedes #13886

This fixes an incompatibility between Ghostty and Kitty 0.47.1+.

Previously, Ghostty handled `C=0` by moving down at most one terminal
height and then clamping the horizontal destination to the screen. The
limit protected against an image command requesting billions of rows,
but it counted ordinary movement to the bottom as well as scrolling.

Kitty defines `C=0` as leaving the cursor after the image and implements
the movement as rows minus one, plus one row when the image reaches the
right edge:

https://sw.kovidgoyal.net/kitty/graphics-protocol/#controlling-displayed-image-layout
0ecb10d158/kitty/graphics.c (L1256-L1260)
0ecb10d158/kitty/screen.c (L1903-L1915)

(Had to view Kitty source to verify what the spec meant)

For example, an eight-row, full-width image in a five-row terminal needs
four moves to reach the bottom and four more to scroll. The old limit
allowed only five moves in total, so the next image started four rows
inside the first one. Clamping the horizontal destination also left the
cursor at the final column instead of wrapping to column one of the next
row. Consecutive images could therefore overlap in both directions.
2026-08-18 08:46:20 -07:00
Mitchell Hashimoto
0a16db3c68 fix(lib-vt): report size when mode 2048 is enabled (#13885)
Mode 2048 requires terminals to report the current rows, columns, and
pixel dimensions [when the mode is
enabled](https://gist.github.com/rockorager/e695fb2924d36b2bcf1fff4a3704bd83#:~:text=When%20first%20enabled%2C%20the%20terminal%20MUST%20send%20a%20report%20of%20the%20current%20size.),
then report updated geometry after later resizes. The native termio
stream already queues the initial report, but the terminal stream only
reported from `resize`, so libghostty consumers that enabled the mode
after committing geometry received nothing until another resize.

This makes the generic handler match termio by requesting current
geometry through the existing size callback and writing the encoded
report through `write_pty` on every enable.
2026-08-18 06:21:50 -07:00
Elias Andualem
5b9a77f203 terminal: document mode 2048 size reports 2026-08-18 15:34:07 +03:00
Elias Andualem
07af4612ba terminal: report size when mode 2048 is enabled 2026-08-18 14:26:37 +03:00
Mitchell Hashimoto
12967b68f7 libghostty: option to retain continuations on snapshot decode (#13878)
Add a snapshot decoder option that leaves continuation tracking enabled
on decoded terminals. This lets caller access the continuation bytes (if
any) that were applied to the terminal.

This lets replay callers export an unfinished parser or UTF-8 sequence
from the returned terminal.

This defaults to off.
2026-08-17 13:39:27 -07:00
Mitchell Hashimoto
9be6c2ea28 libghostty: option to retain continuations on snapshot decode
Add a snapshot decoder option that leaves continuation tracking
enabled on decoded terminals. This lets caller access the continuation
bytes (if any) that were applied to the terminal.

This lets replay callers export an unfinished parser or UTF-8 sequence
from the returned terminal.

This defaults to off.
2026-08-17 13:30:41 -07:00
Mitchell Hashimoto
56e1f3a62e libghostty: buffer the writer adapter used by streaming C APIs (#13877)
The GhosttyWriter adapter was unbuffered, so for streaming writers that
make small writes like the formatter, it produces a crazy amount of
callbacks: one styled HTML page invoked the callback ~50,000 times in a
benchmark lol. This has a particularly large impact on callers who are
supplying callbacks through an expensive FFI interface, like Go.

Change WriterAdapter to have an optional buffer (initBuffered) and use a
4 KB buffer for all current callers. Also optimize single byte splats to
use memset.

Results: that same styled HTML example goes from ~50K callbacks to 124.
And throughput through the C API also improved across every workload I
tested (styled and unstyled text in every format).
2026-08-17 12:54:25 -07:00
Mitchell Hashimoto
846d24e12b libghostty: buffer the writer adapter used by streaming C APIs
The GhosttyWriter adapter was unbuffered, so for streaming writers that
make small writes like the formatter, it produces a crazy amount of callbacks:
one styled HTML page invoked the callback ~50,000 times in a benchmark lol.

Change WriterAdapter to have an optional buffer (initBuffered) and use
a 4 KB buffer for all current callers. Also optimize single byte splats
to use memset.

Results: that same styled HTML example goes from ~50K callbacks to 124.
And throughput through the C API also improved across every workload
I tested (styled and unstyled text in every format).
2026-08-17 12:43:56 -07:00