Commit Graph

14888 Commits (4e47c225b1541339600d24fd0d8d8689292ce848)

Author SHA1 Message Date
Mitchell Hashimoto 4e47c225b1
pkg/afl++ 2026-02-28 21:14:51 -08:00
Mitchell Hashimoto adbb432930
test/fuzz-libghostty: basic afl++-based fuzzer for libghostty 2026-02-28 21:14:51 -08:00
Mitchell Hashimoto 25f12080cb
terminal: bounds check params in DCS passthrough entry (#11088)
When a DCS sequence has more than MAX_PARAMS parameters, entering
dcs_passthrough would write to params[params_idx] without a bounds
check, causing an out-of-bounds access. Add the same guard that
csi_dispatch already has.

Found by AFL fuzzing, test and fix produced by Codex.
2026-02-28 21:14:34 -08:00
Mitchell Hashimoto 12f43dfb7d
fix(terminal): bounds check params in DCS passthrough entry
When a DCS sequence has more than MAX_PARAMS parameters, entering
dcs_passthrough would write to params[params_idx] without a bounds
check, causing an out-of-bounds access. Drop the entire DCS hook
when params overflow, consistent with how csi_dispatch handles it.

Found by AFL fuzzing.
2026-02-28 21:11:40 -08:00
Mitchell Hashimoto 149949190e
Remove old "acceptance tests" (#11086)
We haven't used or run these in forever (literally like 3+ years).
They're just wasting cognitive space and confuse some users as to what
they're for. Remove them.
2026-02-28 14:45:16 -08:00
Mitchell Hashimoto 981901a011
Remove old "acceptance tests"
We haven't used or run these in forever (literally like 3+ years).
They're just wasting cognitive space and confuse some users as to what
they're for. Remove them.
2026-02-28 14:37:23 -08:00
Mitchell Hashimoto b40404b0d9
macOS: fix for Cmd+W window position/size restoration (#11070)
I'd like to contribute a fix for an issue I found regarding how macOS
window restoration works when a window is closed via Cmd+W (leaving the
app active).

Currently, the position cascades down and to the right on every reopen,
and size explicitly resets. Also, explicit `window-position-x/y` configs
get ignored on first launch.

I've diagnosed the issues:
1. In `TerminalWindow.swift`, `setInitialWindowPosition` relies on the
`TerminalController` which isn't present during `awakeFromNib`. I moved
the `screen.origin` calculation directly into the window class to ensure
fixed coordinates are respected immediately.
2. In `TerminalController.swift`, I consolidated the window spawning
cascade logic into a new `applyCascade(to:hasFixedPos:)` helper. It now
only calls `cascadeTopLeft` if `TerminalController.all.count > 1`
(meaning another window is active) and fixed coords aren't set. If it's
the only window, it anchors exactly where `LastWindowPosition` placed
it.
3. In `LastWindowPosition.swift`, I updated the `save` and `restore`
logic to persist the full `window.frame` (origin + size) instead of just
the origin.

*Disclosure: I used Cursor (Tab) to assist in navigating the codebase
and formatting the Swift code, but I fully understand the AppKit
lifecycle changes and edge cases I'm proposing.*

I have the commit locally formatted with `swiftlint` and ready to push!
2026-02-28 14:10:51 -08:00
Abdurrahman 0d5b9d554c
Update macos/Sources/Features/Terminal/TerminalController.swift
apply reviewer suggestion for cascading

Co-authored-by: Lukas <134181853+bo2themax@users.noreply.github.com>
2026-02-28 18:02:40 +01:00
ghostty-vouch[bot] 889a945f74
Update VOUCHED list (#11078)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/11076#discussioncomment-15955432)
from @jcollie.

Vouch: @DiaaEddin

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-28 15:17:15 +00:00
Jeffrey C. Ollie 14166bc84c
Rename `ko.po` back to `ko_KR.po` (#11074)
While it was renamed from `ko_KR.UTF-8.po` to `ko.po` in #10976,
@uhojin, a Korean locale maintainer, [notes] that “ko_KR [*South*
Korean] makes more sense in locale context just to avoid any potential
confusion between 한국어 vs 조선어”.

Despite `ko_KP` (North Korean) not being present in glibc (as of version
2.43), and the ISO639 maintainers [expressing disapproval of `ko_KP`],
it is possible opinions may change in the future, and individual
opinions may be contested—disambiguating doesn't hurt.

Requesting a review from all involved parties; I wish you ***all* opine
before merging**.

[notes]:
https://github.com/ghostty-org/ghostty/pull/10976#discussion_r2861424171
[expressing disapproval of `ko_KP`]:
https://github.com/ghostty-org/ghostty/pull/10976#discussion_r2861359240
2026-02-28 02:49:23 -06:00
Kat de62821973
Rename ko.po back to ko_KR.po.
While it was renamed from ko_KR.UTF-8.po to ko.po in #10976, @uhojin,
a Korean locale maintainer, notes [1] that “ko_KR [*South* Korean] makes
more sense in locale context just to avoid any potential confusion
between 한국어 vs 조선어”.

Despite ko_KP (North Korean) not being present in glibc (as of version
2.43), and the ISO639 maintainers expressing disapproval of ko_KP [2],
it is possible opinions may change in the future, and individual
opinions may be contested—disambiguating doesn't hurt.

[1]: https://github.com/ghostty-org/ghostty/pull/10976#discussion_r2861424171
[2]: https://github.com/ghostty-org/ghostty/pull/10976#discussion_r2861359240
2026-02-28 19:00:35 +11:00
Jeffrey C. Ollie ee0e0ae3dd
Rename `pt.po` back to `pt_BR.po` (#11073)
Follow-up to #10976.

Portugal exists! [Wikipedia notes it] to be the main other dialect.
There's already a PR for `pt_PT` support too: #9078.

[Wikipedia notes it]: https://en.wikipedia.org/wiki/Portuguese_dialects
2026-02-28 01:48:09 -06:00
Kat 9192276d3e
Rename pt.po back to pt_BR.po.
Portugal exists! Wikipedia notes [1] it to be the main other dialect.
There's already a PR for pt_PT support too:
https://github.com/ghostty-org/ghostty/pull/9078.

It was renamed from pt_BR.UTF-8.po to pt.po in #10976.

[1]: https://en.wikipedia.org/wiki/Portuguese_dialects
2026-02-28 17:43:08 +11:00
ghostty-vouch[bot] 6d6dc9a114
Update VOUCHED list (#11071)
Triggered by
[comment](https://github.com/ghostty-org/ghostty/issues/11070#issuecomment-3976278687)
from @mitchellh.

Vouch: @abdurrahmanski

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-28 03:52:52 +00:00
A-AKB 6e622f8c75 fix(macos): extract window cascade logic into helper function 2026-02-28 01:43:00 +01:00
A-AKB 0db32ab9a8 macos: fix window size/position restoration on Cmd+W close
This fixes two overlapping issues regarding window positioning and Cmd+W window closures on macOS:

1. `window-position-x` and `window-position-y` coordinates were being ignored on initial launch because `TerminalWindow.setInitialWindowPosition` depended on the `TerminalController`, which isn't fully attached during `awakeFromNib`. This logic was moved so explicit coordinates are correctly enforced.
2. When closing a window via Cmd+W (leaving the app active), reopening the window would continuously cascade down and to the right rather than restoring to the previous position. It now checks if there are other windows open before cascading.
3. `LastWindowPosition` was updated to save both the frame origin and size (width/height), ensuring that restoring a closed window correctly mimics native AppKit State Restoration size behaviors while honoring explicit configurations.
2026-02-28 01:34:18 +01:00
trag1c 71cb9debb9
Fix a few typos (#11068) 2026-02-27 22:27:04 +01:00
Kat 608da647cb
Elaborate on X-Generator removal.
That line was intended to guide those who do not normally edit po files
with a plain text editor, but ended up sounding like it states the
obvious (“to do X, do X”) before this change.
2026-02-28 08:13:19 +11:00
Kat 414c80ce35
Improve word grouping w.r.t. localization team names.
“always include a language and a country code” reads as “always include
a language, and also always include a country code”, while the intended
meaning was that it includes both a language *code* and a country code.
2026-02-28 08:06:01 +11:00
Kat d75725bd4d
Remove duplicate word in README_TRANSLATORS § CODEOWNERS. 2026-02-28 08:06:01 +11:00
Mitchell Hashimoto 705d8c61ce
config: disable palette-generate by default (#11067)
Following the discussion at #10852, I believe this is the right default.
I'm willing to continue to revisit this decisions, but Ghostty 1.3 is
around the corner and I don't think such a change like this should be
pushed into it.

This was proposed before but I wanted to wait to iron out any bugs here
and I think we have. Namely we identified one bug where we were
accidentally overriding our _default_ palette which shouldn't happen.
But now that it has sat awhile and we've gathered enough feedback, I'm
willing to commit to it.

In general, we got **very little negative feedback.** The linked
discussion shows very little activity relative to other more
controversial changes we've made. It has basically 1 upvote with around
5 participants whereas our most popular or breaking features/bugs have
had at least dozens if not over a hundred. I think this shows that this
change isn't that disruptive, either because the colors work fine or
because not that many things use the 256-color palette (probably the
latter moreso but a mix for sure). For that reason, I do think
revisiting this at some point is warranted.

I think palette generation is best left as a _theme author_ tool. A
Ghostty color theme could include `palette-generate=true` if it wants to
customize the 256-color palette more easily. Of course, end users can as
well anytime.

Another part of my reasoning is that TUI programs who want this behavior
can already achieve it themselves by mixing dark/light theme detection
via CSI 996
(https://contour-terminal.org/vt-extensions/color-palette-update-notifications/)
with OSC 4/10/11 color query and change sequences, both of which are
decently supported in the terminal ecosystem and fully supported in
Ghostty.

I'm also open to considering some kind of new sequence to make this
easier for TUIs (probably a mode) where they can opt-in to palette
generation plus "harmonius" palettes (see `palette-harmonius`) and
Ghostty does it on demand then. I think that'd solve the legacy vs new
TUI argument where legacy programs can continue to make assumptions
about the palette and new programs can opt-in to a more dynamic palette
without having to do a lot of work themselves.

cc @jake-stewart
2026-02-27 11:41:38 -08:00
Mitchell Hashimoto c78d9cba9e
config: disable palette-generate by default
Following the discussion at #10852, I believe this is the right default.
I'm willing to continue to revisit this decisions, but Ghostty 1.3 is
around the corner and I don't think such a change like this should be
pushed into it.

I think palette generation is best left as a _theme author_ tool. A
Ghostty color theme could include `palette-generate=true` if it wants
to customize the 256-color palette more easily. Of course, end users can
as well anytime.

Another part of my reasoning is that TUI programs who want this behavior
can already achieve it themselves by mixing dark/light theme detection
via CSI 996 (https://contour-terminal.org/vt-extensions/color-palette-update-notifications/)
with OSC 4/10/11 color query and change sequences, both of which are
decently supported in the terminal ecosystem and fully supported in
Ghostty.

I'm also open to considering some kind of new sequence to make this
easier for TUIs (probably a mode) where they can opt-in to palette
generation plus "harmonius" palettes (see `palette-harmonius`) and
Ghostty does it on demand then. I think that'd solve the legacy vs new
TUI argument where legacy programs can continue to make assumptions
about the palette and new programs can opt-in to a more dynamic palette
without having to do a lot of work themselves.
2026-02-27 11:32:15 -08:00
Mitchell Hashimoto 3a21305d09
fix(macOS): filter phantom mouse events that defeat mouse-hide-while-typing (#11066)
## Summary

Ports the phantom mouse-motion position-equality check from the GTK
runtime to the embedded runtime (used by macOS).

On macOS, TUI apps like Zellij that frequently update the window title
cause phantom `mouseMoved` events at the same coordinates. These flow
through `embedded.zig` → `Surface.zig` `cursorPosCallback` →
`showMouse()`, which explicitly calls
`NSCursor.setHiddenUntilMouseMoves(false)` and unhides the cursor,
defeating `mouse-hide-while-typing`.

The GTK runtime already filters these in PR #4973 (for #3345):

```zig
const is_cursor_still = @abs(priv.cursor_pos.x - pos.x) < 1 and
    @abs(priv.cursor_pos.y - pos.y) < 1;
if (is_cursor_still) return;
```

This PR adds the same check to `embedded.zig`'s `cursorPosCallback`,
using the already-stored `self.cursor_pos` field.

## Test plan

- [x] Enable `mouse-hide-while-typing = true` in Ghostty config
- [ ] Run a TUI app that updates the window title frequently (e.g.
Zellij)
- [ ] Type — cursor should hide and stay hidden despite title updates
- [ ] Move the mouse — cursor should reappear normally
- [ ] Verify no regressions with normal mouse movement,
focus-follows-mouse, or link hovering
2026-02-27 11:25:18 -08:00
Lukas df53f75ad1
macOS: refine window tint for liquid glass (#11018)
Depends on #11030

- Update constraints of `TerminalGlassView`
- Use `TerminalViewContainer.DerivedConfig` to map styling properties
- Add TerminalViewContainerTests
- Instead of using delay, now the view updates are explicitly called by
window controllers
2026-02-27 10:49:12 -08:00
ghostty-vouch[bot] b0657036a0
Update VOUCHED list (#11065)
Triggered by
[comment](https://github.com/ghostty-org/ghostty/issues/11064#issuecomment-3974502615)
from @mitchellh.

Vouch: @linustalacko

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-27 18:48:04 +00:00
Mitchell Hashimoto 0bdd3bb6b5
feat(vt): Parse UAPI OSC 3008 hierarchical context signalling (#11057)
Implements parsing for OSC 3008, which allows terminal emulators to keep
track of the stack of processes that have current control over the tty.
The implementation mirrors existing `semantic_prompt.zig` architecture
and natively maps UAPI definitions to Zig structures with lazy
evaluation for optional metadata.

Fixes #10900
2026-02-27 10:46:35 -08:00
Prakhar54-byte eafdbaaada refactor: simplify Enum parse call and loop parsing logic 2026-02-27 22:58:08 +05:30
linustalacko 2a41401463 fix(macOS): filter phantom mouse events that defeat mouse-hide-while-typing
On macOS, TUI apps like Zellij that frequently update the window title
cause phantom mouse-move events to be generated at the same coordinates.
These phantom events reach cursorPosCallback in the core, which calls
showMouse() and explicitly unhides the cursor via
NSCursor.setHiddenUntilMouseMoves(false), defeating the
mouse-hide-while-typing feature.

This ports the same position-equality check already present in the GTK
runtime (added in PR #4973 for issue #3345) to the embedded runtime used
by macOS. If the cursor position hasn't changed by more than 1px, the
event is discarded.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 09:08:13 -08:00
ghostty-vouch[bot] 99311e8c27
Update VOUCHED list (#11062)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/11061#discussioncomment-15949027)
from @mitchellh.

Vouch: @adrum

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-27 16:54:02 +00:00
Prakhar54-byte 3e1004717b refactor: apply PR feedback
- Use `std.meta.stringToEnum` in ContextType and ExitStatus
- Ensure `parseInt` only accepts digits for pids
- Use `@tagName` for string representation in Field
- Rename `fields_raw` to `metadata`
- Rename `readField` to `readOption`
2026-02-27 22:20:42 +05:30
Mitchell Hashimoto b6d26f258b
core: add tests for `ghostty.h` (#11051)
* ensure that `ghostty.h` compiles during basic Zig tests
* ensure that non-exhaustive enums are kept synchronized between
`ghostty.h` and their respective Zig counterpart.
* adjust some enums that varied from established conventions
2026-02-27 08:39:22 -08:00
Mitchell Hashimoto c61c8f9e30
minor moving stuff 2026-02-27 08:38:09 -08:00
Jeffrey C. Ollie cdf0dd15e9
testing: use std.Build.TranslateC instead of @cImport 2026-02-27 10:13:03 -06:00
ghostty-vouch[bot] 537a2bccef
Update VOUCHED list (#11058)
Triggered by
[comment](https://github.com/ghostty-org/ghostty/issues/11057#issuecomment-3973652560)
from @mitchellh.

Vouch: @Prakhar54-byte

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-27 15:46:03 +00:00
Prakhar54-byte 9da6588c16 feat(vt): Parse UAPI OSC 3008 hierarchical context signalling
Implements parsing for OSC 3008, which allows terminal emulators to keep track of the stack of processes that have current control over the tty. The implementation mirrors existing `semantic_prompt.zig` architecture and natively maps UAPI definitions to Zig structures with lazy evaluation for optional metadata.

Fixes #10900
2026-02-27 21:10:42 +05:30
Jeffrey C. Ollie ea5b07d20f
core: add tests for `ghostty.h`
* ensure that `ghostty.h` compiles during basic Zig tests
* ensure that non-exhaustive enums are kept synchronized between
  `ghostty.h` and their respective Zig counterpart.
* adjust some enums that varied from established conventions
2026-02-27 09:22:23 -06:00
Jeffrey C. Ollie b30db91e69
build: test that `ghostty.h` compiles during a normal `zig build test` 2026-02-27 09:22:22 -06:00
Mitchell Hashimoto a476bef118
Assorted additions to `README_TRANSLATORS` (#11047)
Optionally see individual commit descriptions.

Re review requests:
- I'm requesting a review from @pluiedev because she wrote the document.
Feel free to ignore or remove your request.
- @jcollie's text about CODEOWNERS from #10976 was rewritten, so I felt
it would be appropriate to ask jcollie to check the new text.
2026-02-27 07:18:40 -08:00
Mitchell Hashimoto 6074e8b1fa
macos: workaround for `TabTitleEditor` alignment issue (#11052)
Fixes #10993



https://github.com/user-attachments/assets/666803f9-05aa-4c86-ab4a-7a183d471e33
2026-02-27 07:11:54 -08:00
ghostty-vouch[bot] eb5b73639b
Update VOUCHED list (#11055)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/11053#discussioncomment-15946894)
from @jcollie.

Vouch: @icodesign

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-27 13:24:00 +00:00
Lukas e55ebf0008
macos: workaround for TabTitleEditor alignment issue 2026-02-27 10:21:11 +01:00
Mitchell Hashimoto 32a9d35c81
macos: DockTilePlugin finds app bundle via `.app` suffix (#11049)
Fixes #11029 (probably)

If you renamed the app bundle, the prior check would infinite loop due
to the combination of two bugs: invalid termination checks and
hardcoding "Ghostty.app"
2026-02-26 20:03:23 -08:00
Mitchell Hashimoto 3ee63035d3
macos: DockTilePlugin finds app bundle via `.app` suffix
Fixes #11029 (probably)

If you renamed the app bundle, the prior check would infinite loop due
to the combination of two bugs: invalid termination checks and
hardcoding "Ghostty.app"
2026-02-26 19:58:53 -08:00
Mitchell Hashimoto f19d847f95
core: parse cmdline and cmdline_url semantic prompt options (#11046) 2026-02-26 19:36:38 -08:00
Kat f833928fcd
Document localization teams. 2026-02-27 13:50:30 +11:00
Kat d68f51672e
Prefer present over future tense in translators' guide. 2026-02-27 13:50:30 +11:00
Kat d50368137f
Elaborate on viewing translations.
Documenting `--language` was suggested by @Filip7 in
https://github.com/ghostty-org/ghostty/pull/10976#issuecomment-3969285334
2026-02-27 13:50:30 +11:00
Kat 848d8afecc
Document common mistakes in translations.
trag1c or I point these out manually whenever we see them, but they're
extremely common and probably deserve being explicitly documented.

“Style Guide” was made sentence case because no other title is in title
case.

Before anyone comments: I use “full stop” instead of “period” because
the Unicode Character Database uses “full stop” instead of “period”, and
I avoid “dot” because Unicode has a plethora of dots.
2026-02-27 13:50:30 +11:00
Kat dea263a8ae
Correct “i.e. de, es, and fr” to use “e.g”.
That isn't a rephrasing of “language codes”, but rather lists examples.
2026-02-27 13:42:30 +11:00
Mitchell Hashimoto 336ca18845
Update `language` config option's documentation (#11043)
Follow-up to #10976.
2026-02-26 16:22:37 -08:00