16108 Commits

Author SHA1 Message Date
kat f9a9d33b3a docs(input): add documentation for missing action parameters (#12579)
### AI Disclosure

Claude generated all the commits, I reviewed it and created this PR
tip
2026-05-05 08:59:39 +00:00
Lukas 5874ce633c Apply suggestions from code review
Co-authored-by: kat <65649991+00-kat@users.noreply.github.com>
Co-authored-by: Lukas <134181853+bo2themax@users.noreply.github.com>
2026-05-05 09:47:06 +02:00
Jeffrey C. Ollie ac48a9b15b build(deps): bump cachix/install-nix-action from 31.10.5 to 31.10.6 (#12584)
Bumps
[cachix/install-nix-action](https://github.com/cachix/install-nix-action)
from 31.10.5 to 31.10.6.
<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.10.6</h2>
<h2>What's Changed</h2>
<ul>
<li>nix: 2.34.6 -&gt; 2.34.7 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/275">cachix/install-nix-action#275</a>
<strong><a
href="https://github.com/NixOS/nix/security/advisories/GHSA-vh5x-56v6-4368">GHSA-vh5x-56v6-4368</a></strong>:
Fixes a coroutine stack-to-heap overflow via unbounded recursion in the
NAR directory parser. <strong>Severity: High.</strong>
<strong><a
href="https://github.com/NixOS/nix/security/advisories/GHSA-gr92-w2r5-qw5p">GHSA-gr92-w2r5-qw5p</a></strong>:
Fixes an absolute path traversal vulnerability when unpacking archives
to disk. Severity: Moderate.</li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/cachix/install-nix-action/compare/v31...v31.10.6">https://github.com/cachix/install-nix-action/compare/v31...v31.10.6</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/cachix/install-nix-action/commit/8aa03977d8d733052d78f4e008a241fd1dbf36b3"><code>8aa0397</code></a>
Merge pull request <a
href="https://redirect.github.com/cachix/install-nix-action/issues/275">#275</a>
from cachix/create-pull-request/patch</li>
<li><a
href="https://github.com/cachix/install-nix-action/commit/21d0b780f08a47ae2baf9814c722ef3884db92aa"><code>21d0b78</code></a>
nix: 2.34.6 -&gt; 2.34.7</li>
<li>See full diff in <a
href="https://github.com/cachix/install-nix-action/compare/ab739621df7a23f52766f9ccc97f38da6b7af14f...8aa03977d8d733052d78f4e008a241fd1dbf36b3">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.10.5&new-version=31.10.6)](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-05-04 23:10:07 -05:00
dependabot[bot] 81e399c412 build(deps): bump cachix/install-nix-action from 31.10.5 to 31.10.6
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 31.10.5 to 31.10.6.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Changelog](https://github.com/cachix/install-nix-action/blob/master/RELEASE.md)
- [Commits](https://github.com/cachix/install-nix-action/compare/ab739621df7a23f52766f9ccc97f38da6b7af14f...8aa03977d8d733052d78f4e008a241fd1dbf36b3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-05 03:08:21 +00:00
Mitchell Hashimoto 563b085a4d Fix zero-width grapheme attachment during pending wrap (#12581)
This PR fixes an issue where a zero-width combining mark could attach to
the wrong cell when the preceding character was written in the final
column and the cursor had a pending wrap.

The test I added used to fail before the fix, but it passes now.
2026-05-04 14:37:31 -07:00
Mitchell Hashimoto c2c0901ed0 Update iTerm2 colorschemes (#12562)
Upstream release:
https://github.com/mbadolato/iTerm2-Color-Schemes/releases/tag/release-20260427-153600-5e4d1de
2026-05-04 14:17:29 -07:00
Riccardo Mazzarini c20fcfa1b4 Fix zero-width grapheme attachment during pending wrap
This PR fixes an issue where a zero-width combining mark could attach to
the wrong cell when the preceding character was written in the final
column and the cursor had a pending wrap.
2026-05-04 23:16:41 +02:00
Claude Opus 4.7 df44c6dd83 docs(input): document close_tab arguments 2026-05-04 18:39:02 +02:00
Claude Opus 4.7 b1b01741f6 docs(input): document navigate_search arguments 2026-05-04 16:57:56 +02:00
Claude Opus 4.7 248df8e7aa docs(input): document copy_to_clipboard arguments 2026-05-04 16:57:37 +02:00
ghostty-vouch[bot] 1547dd667a Update VOUCHED list (#12564)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/12563#discussioncomment-16793038)
from @jcollie.

Vouch: @agoodkind

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-05-03 02:02:22 +00:00
mitchellh 28767f62b1 deps: Update iTerm2 color schemes 2026-05-03 00:30:37 +00:00
Mitchell Hashimoto f0bb6ed9ee macos: avoid replaying keys that commit preedit (#12547)
Refs #10460
Related: #12518

When an input method commits all or part of marked text during keyDown,
AppKit returns the committed text through insertText. Treat that as text
committed by the input method instead of replaying the original key
event to the terminal.

Previously this path only handled arrow-key commits specially. A
control-key shortcut that commits preedit text could still be encoded as
the original control input after composition, such as ctrl+j becoming
LF.

Send committed preedit text as a text-only event for any key that causes
the commit. Only replay arrow navigation keys that the existing Korean
IME handling expects, and keep plain left-arrow suppressed because
AppKit already leaves the caret in place.

Before:
<img width="375" height="375" alt="before"
src="https://github.com/user-attachments/assets/1073b93f-625a-4881-8f95-67adefe9d3da"
/>

After:
<img width="375" height="375" alt="after"
src="https://github.com/user-attachments/assets/3e4be2a5-4df9-4cdd-bc95-e178ca44c7e7"
/>

AI usage: OpenAI Codex helped investigate, implement, test, and refine
this change. I reviewed and tested the resulting code.
2026-05-02 08:24:42 -07:00
Mitchell Hashimoto 058d054fa2 libghostty-vt: support building on macOS with Nix (#12548)
Adds support for building libghostty-vt on macOS with Nix.

Tested on aarch64-darwin. Tests pass as well.

_Claude used to speed up debugging process. All comments, commit
messages, and final code authored by me._
2026-05-02 08:14:33 -07:00
ghostty-vouch[bot] f27aa865af Update VOUCHED list (#12552)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/12542#discussioncomment-16785276)
from @00-kat.

Denounce: @MorgenGeluk

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-05-02 01:55:53 +00:00
Sander 7123bddc18 libghostty-vt: fix linker tests for darwin 2026-05-01 16:44:52 +02:00
Sander d17e5517c7 libghostty-vt: fix dependency path resolution errors
Zigs build infra computes relatives paths to build-time executables that use `setCwd.`
The logic is purely lexical and doesn't take into account symlinks, unlike `chdir` that follows symlinks.

If the `cwd` resolves to a different depth, then the relative path becomes incorrect.
2026-05-01 16:44:52 +02:00
Sander 9df670cb55 build: skip unnecessary steps for libghostty-vt 2026-05-01 16:22:23 +02:00
Sander a971bf16a0 libghostty-vt: support building nix derivation on darwin 2026-05-01 16:22:00 +02:00
Akinori Musha d60a16c146 macos: avoid replaying keys that commit preedit
Refs #10460
Related: #12518

When an input method commits all or part of marked text during keyDown,
AppKit returns the committed text through insertText. Treat that as
text committed by the input method instead of replaying the original key
event to the terminal.

Previously this path only handled arrow-key commits specially. A
control-key shortcut that commits preedit text could still be encoded as
the original control input after composition, such as ctrl+j becoming LF.

Send committed preedit text as a text-only event for any key that causes
the commit. Only replay arrow navigation keys that the existing Korean
IME handling expects, and keep plain left-arrow suppressed because AppKit
already leaves the caret in place.

AI usage: OpenAI Codex helped investigate, implement, test, and refine
this change. I reviewed and tested the resulting code.
2026-05-01 23:18:42 +09:00
ghostty-vouch[bot] 35c0e2572f Update VOUCHED list (#12545)
Triggered by
[comment](https://github.com/ghostty-org/ghostty/issues/12544#issuecomment-4359105411)
from @trag1c.

Vouch: @erral

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-05-01 11:38:57 +00:00
Mitchell Hashimoto 4dcb09ada0 macos: suppress control-char input while composing (#12518)
macos: suppress control-char input while composing

When AppKit delivers a single C0 control character during marked-text
composition, Ghostty should treat it as input consumed by the composing
state instead of forwarding it to the terminal.

This prevents control-key IME actions, such as Japanese input shortcuts
like ctrl+h/j/m/n, from leaking into the terminal while composition is
still active. Printable text and non-composing control input continue
through the normal key path.

Refs #10460
Related: #2628, #4539
Vouched in #12169

Testing:
- xcodebuild test -scheme Ghostty -destination platform=macOS
-only-testing:GhosttyTests/SurfaceViewAppKitTests
- Manually tested Japanese IME control-key shortcuts on macOS

AI usage:
- OpenAI Codex helped investigate, implement, test, and refine this
change. I reviewed and tested the resulting code.
2026-04-30 06:48:58 -07:00
Mitchell Hashimoto 95b56eb525 macOS: fix focus state when toggling command palette from inline title editor (#12524)
A bug found while recording that menu fix.
> ~~Will link to an open issue if there is one.~~

When toggling the command palette from the inline title editor, the
first responder state of the surface is changed quickly from true to
false.

`makeFirstResponder:` is called by the title editor when finishing, but
it happens **after** the command palette is shown, so the `focused` is
set to `true` while the command palette is shown. (Could be an AppKit
issue as well, since the resign is not called after but the command
palette is receiving `keyDown`.)

Since `performKeyEquivalent(with:)` is called on all of the subviews
until one of the return `true` so the paste action is consumed by the
surface instead of the first responder (command palette).
2026-04-30 06:42:12 -07:00
Mitchell Hashimoto 1623daf21c macOS: enable copy only when there’s actual selected text (#12521)
This matches the `peformable` definition and the default behaviors of
text editing on macOS.
2026-04-30 06:41:04 -07:00
Mitchell Hashimoto 25cd206e25 chore(macOS): remove Ghostty.xctestplan in project tree. (#12520)
`lastKnownFileType = file` will change to `text` if you checking out
branches with Xcode opened. But this was generated by Xcode in the first
place.

Anyway we don't need it to be in the project tree to run the tests, and
you can still open the test plan in scheme editor.
2026-04-30 06:39:09 -07:00
Mitchell Hashimoto 83ae47191a Fall back to Zig-bundled Darwin headers when an SDK can't be found (#12534)
Currently, cross to Darwin uses the Darwin headers bundled with Zig.
However, if you're running a build _on_ Darwin, an error is thrown if
the SDK can't be found, even though the bundled headers are still
available.

Now, we continue to search for and prefer the installed SDK, but if it
can't be found, we fall back to the bundled headers rather than failing
the build.
2026-04-30 06:38:41 -07:00
ghostty-vouch[bot] f5664cd7b0 Update VOUCHED list (#12533)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/12530#discussioncomment-16765566)
from @jcollie.

Vouch: @Samasaur1

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-04-30 06:29:58 +00:00
Sam f8f3b6f694 Fall back to Zig-bundled Darwin headers when an SDK can't be found
Currently, cross to Darwin uses the Darwin headers bundled with Zig.
However, if you're running a build _on_ Darwin, an error is thrown if
the SDK can't be found, even though the bundled headers are still
available.

Now, we continue to search for and prefer the installed SDK, but if it
can't be found, we fall back to the bundled headers rather than failing
the build.
2026-04-29 22:15:20 -07:00
Lukas 61595b5ec9 macOS: fix focus state when toggling command palette from inline title editor 2026-04-29 22:41:18 +02:00
Lukas 6fdca6bb53 macOS: enable copy only when there’s actual selected text 2026-04-29 19:33:09 +02:00
Lukas dbffe994db chore: remove Ghostty.xctestplan in project tree.
`lastKnownFileType = file` will change to `text` if you checking out branches with Xcode opened. But this was generated by Xcode in the first place.

Anyway we don't need it to be in the project tree to run the tests, and you can still open the test plan in scheme editor.
2026-04-29 19:24:03 +02:00
Akinori Musha a43cc02ebd macos: suppress control-char input while composing
When AppKit delivers a single C0 control character during
marked-text composition, Ghostty should treat it as input consumed by
the composing state instead of forwarding it to the terminal.

This prevents control-key IME actions, such as Japanese input
shortcuts like ctrl+h/j/m/n, from leaking into the terminal while
composition is still active. Printable text and non-composing control
input continue through the normal key path.

AI usage: OpenAI Codex helped investigate, implement, test, and refine
this change. I reviewed and tested the resulting code.
2026-04-29 22:50:35 +09:00
Mitchell Hashimoto 6590196661 Fix speedy high-resolution scrolling on Linux (#12483)
Enforcing an absolute minimum of 1 for scroll events causes differing
scroll speeds between high-resolution and standard scroll wheels on
Linux. Since this was added to handle MacOS's precision scrolling
emulation, this patch alters the behaviour so that the absolute minimum
is only enforced on MacOS.

NB: This can't just be fixed by adjusting `mouse-scroll-multiplier`
since that affects *all* scroll events whether they're high-resolution
or not. Reducing `mouse-scroll-multiplier` to handle high-res scroll
events better makes scrolling unusably slow for regular scroll wheels
connected to the same machine.

Fixes #11648.
2026-04-27 13:33:46 -07:00
Aditya Bhargava 5871a2d4f0 zig-fmt cleanup 2026-04-27 16:28:23 -04:00
Aditya Bhargava 154169b054 Fix speedy high-resolution scrolling on Linux
Enforcing an absolute minimum of 1 for scroll events causes differing
scroll speeds between high-resolution and standard scroll wheels on
Linux. Since this was added to handle MacOS's precision scrolling
emulation, this patch alters the behaviour so that the absolute minimum
is only enforced on MacOS.

Fixes #11648.
2026-04-27 16:28:23 -04:00
Mitchell Hashimoto 2cbe706276 macOS: fix keybindings for end_search not working correctly (#12492)
This now fixes #11410 completely, `navigate_search:next` and
`navigate_search:previous` are already fixed in
18f2702225.

Also fixes: surface is not focused after ending search via menu bar
2026-04-27 13:14:08 -07:00
Mitchell Hashimoto 8925a91c5c update zon2nix to 0.5.0 (#12488)
fix hash outputs for flatpak
2026-04-27 13:13:46 -07:00
Jeffrey C. Ollie acbaa47de5 switch back to older nixpkgs 2026-04-27 13:53:02 -05:00
Jeffrey C. Ollie 8f3d9b4690 update zon2nix to 0.5.0
fix hash outputs for flatpak
build with Zig 0.16 from nixpkgs
(which required fixing prettier reference in devShell.nix)
2026-04-27 12:42:04 -05:00
Lukas 97c5a21aba macOS: fix ending search in menu bar does focus on surface 2026-04-27 19:03:06 +02:00
Lukas 1df7a5d3f3 macOS: update keybind for end_search 2026-04-27 18:55:31 +02:00
Mitchell Hashimoto 34cbb5fa81 feat: add middle-click action configuration (#12478)
This PR addresses
https://github.com/ghostty-org/ghostty/discussions/12108 implemented
similarly to https://github.com/ghostty-org/ghostty/pull/8254 to allow
middle click + TrackPoint scrolling on MacOS. `primary-paste` naming
comes from `gtk_enable_primary_paste`.

The following configuration values for `middle-click-action` are
provided:
- `primary-paste` - Paste from the selection (or system) clipboard per
`copy-on-select`.
- `ignore` - Do nothing, ignore the middle click.

Tested locally on macOS with Zig 0.15.2 using `zig build
-Doptimize=ReleaseFast`.

Thank you!
2026-04-27 09:29:29 -07:00
Mitchell Hashimoto 0b56ae2cc7 gtk: fix quick terminal breaking when manually toggled off while auto-hide is enabled (#12471)
Fixes quick terminal breaking when auto-hide is enabled and quick
terminal is manually toggled off (#11679).

`quick-terminal-autohide` is implemented by the `Window.propIsActive`
function in `apprt/gtk/class/window.zig` which calls
`Window.toggleVisibility` when the quick terminal window becomes
inactive (loses focus). However `Window.propIsActive` is also triggered
when you manually hide the quick terminal because hiding it causes the
window to become inactive. Normally that should just toggle the quick
terminal off and immediately back on, but there is also a re-entrancy
issue. Manually toggling off the terminal causes the
`Application.toggleQuickTerminal` (in `apprt/gtk/class/application.zig`)
to run which sets off the call chain `Window.toggleVisibility ->
gtk_widget_set_visible -> ... GTK signal/event handling ... ->
Window.propIsActive -> Window.toggleVisibility ->
gtk_widget_set_visible`.
The nested calls to `gtk_widget_set_visible` cause the GTK window state
to become corrupted. The window is marked visible, but is not actually
visible or just shows a placeholder. What exactly happens depends on the
compositor and how it handles moving window focus.

Reproduced the bug on KDE and hyprland and verified the fix on both.

### Changes

`apprt/gtk/class/window.zig`: added check to `Window.propIsActive` to
only toggle quick-terminal if it is inactive **and** visible.

### AI Disclosure

Found the bug without AI using "printf debugging" then traced it through
GTK with valgrind. Used GPT5.4 in setting up valgrind and researching
how signals/events move through GTK internally.
2026-04-27 09:26:24 -07:00
Mitchell Hashimoto 576d07ffc1 macOS: update tests and add test plan (#12473)
This updates UI tests and adds a test plan on disk, so we can change the
configuration to different ones with the host app.

If you changed the icon in regular ghostty config file, the tests can
only be run once, since the signature is changed after changing the
icon. Adding an on-disk test plan helps us to better control the
environment for the tests.
2026-04-27 09:25:51 -07:00
Mitchell Hashimoto 1ed22a5210 renderer: fix preedit range width (#12479)
Related to #12466

`Preedit.range()` returns an inclusive range, but the end position was
calculated as `start + w`. For wide preedit text, this covers one extra
cell.

In Debug builds, Korean IME composition between existing Hangul
characters can panic with:
`index out of bounds: index 2, len 2`

I reproduced this reliably when there are two Hangul characters to the
right of the cursor. For example, type `가나다`, move the cursor between
`가` and `나`, then start a new Korean IME composition. With the old range
calculation, the renderer skips the first wide character plus the head
cell of the next wide character, then resumes on that character's spacer
tail.

This changes the inclusive end to `start + (w - 1)` and adds focused
tests for narrow, wide, and right-edge preedit ranges.

This does not fully fix the visual behavior reported in #12466. The
adjacent character can still disappear during composition, so this PR
only fixes the crash side of the problem.
2026-04-27 09:24:55 -07:00
Mitchell Hashimoto c19ce03b3e fix: update Se terminfo entry to reset cursor to configured default (#12487)
## Problem

Current `Se` sequence (reset cursor style) is `\E[2 q`, which always
sets steady block, regardless of user config.

## Solution

Update sequence to `\E[0 q`, which sets the cursor style to the user
configured default cursor.

fix https://github.com/ghostty-org/ghostty/issues/12482
Helps with neovim issue: https://github.com/neovim/neovim/issues/38987

## AI Disclosure

I didn't use AI for this, haha. Unless you count random questions to
learn about terminfo beforehand, but I relied on [legit
resources](https://invisible-island.net/xterm/terminfo.html) for real
info. It says:

>  Se resets the cursor style to the terminal power-on default.

I think the useful interpretation is to set the user configured default.
2026-04-27 09:23:51 -07:00
Mitchell Hashimoto 5031973623 input: remove translated in capi (#12490)
Follow up for a3462dd2bd

<img width="884" height="255" alt="image"
src="https://github.com/user-attachments/assets/da4e4dd5-e645-40ed-8e9c-0ed8c9aee1c4"
/>
2026-04-27 09:23:25 -07:00
Lukas 971753074b input: remove translated in capi
Follow up for a3462dd2bd
2026-04-27 13:39:51 +02:00
Kyle Sower 6c68650920 fix: update Se terminfo entry to reset cursor to configured default 2026-04-26 22:31:01 -05:00
ghostty-vouch[bot] 8769d32202 Update VOUCHED list (#12485)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/12484#discussioncomment-16723661)
from @jcollie.

Vouch: @kylesower

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-04-27 03:16:59 +00:00