Commit Graph

15038 Commits

Author SHA1 Message Date
Mitchell Hashimoto
04aff46022 macos: add build script, update AGENTS.md, skip UI tests
This is an update to address common agentic issues I run into,
but the `build.nu` script may be generally helpful to people using
the Nix env since `xcodebuild` is broken by default in Nix due to the
compiler/linker overrides Nix shell does.
2026-03-05 19:55:50 -08:00
Mitchell Hashimoto
3e220ab375 Windows build fixes (#11195)
Some more fixes to get Windows building again. `zig build` on
x64_64-windows now succeeds but `zig build test` fails in
`src/terminal/page.zig` because Zig/Windows lacks a POSIX `mmap`
implementation.
2026-03-05 12:59:06 -08:00
Jeffrey C. Ollie
b1d3e36e2e windows: add GetComputerNameA so that hostname-related functions work 2026-03-05 10:03:58 -06:00
Jeffrey C. Ollie
d29e1cc137 windows: use explicit error sets to work around lack of file locking 2026-03-05 09:29:04 -06:00
Jeffrey C. Ollie
cccdb0d2ad windows: add trivial implementation of expandHome 2026-03-05 09:28:02 -06:00
Jeffrey C. Ollie
e8aad10326 windows: avoid the use of wcwidth 2026-03-05 09:26:52 -06:00
ghostty-vouch[bot]
e1f4ee7fdd Update VOUCHED list (#11192)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/11184#discussioncomment-16011801)
from @mitchellh.

Vouch: @mac0ne

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-05 14:53:00 +00:00
ghostty-vouch[bot]
f36b903479 Update VOUCHED list (#11191)
Triggered by
[comment](https://github.com/ghostty-org/ghostty/issues/11190#issuecomment-4005537826)
from @00-kat.

Vouch: @AnthonyZhOon

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-05 14:40:10 +00:00
Jeffrey C. Ollie
acf54a9166 windows: use new callconv convention 2026-03-05 08:26:08 -06:00
Jon Parise
42540f44cd fix: zsh shell integration when sudo and ssh aliases are defined (#11185)
I encountered an issue related to
https://github.com/ghostty-org/ghostty/discussions/8641 and
https://github.com/ghostty-org/ghostty/pull/8647, but in `zsh` instead
of `bash`.

One of my aliases is:

```bash
alias sudo='sudo '
```

Which causes following error when sourcing the zsh shell integrations:

```shell
source /usr/share/ghostty/shell-integration/zsh/ghostty-integration
/usr/share/ghostty/shell-integration/zsh/ghostty-integration:149: defining function based on alias `sudo'
/usr/share/ghostty/shell-integration/zsh/ghostty-integration:233: parse error near `()'
```
2026-03-05 09:08:21 -05:00
Leah Amelia Chen
dd575c7160 GTK: add 'move' to the drop target actions (#11182)
Fixes #11175
2026-03-05 15:27:41 +08:00
Jeffrey C. Ollie
c920a88cdc GTK: add 'move' to the drop target actions
Fixes #11175
2026-03-04 23:31:41 -06:00
Kat
0b802e7c2e i18n: add Vietnamese translation (#8912)
Adds support for the Vietnamese language
2026-03-05 05:30:59 +00:00
Mitchell Hashimoto
fe1e25f7a6 terminal: bound link regex search work with Oniguruma retry limits (#11181)
Fixes #11177

Use per-search Oniguruma match params (retry_limit_in_search) in
StringMap-backed link detection to avoid pathological backtracking hangs
on very long lines.

The units are ticks in the internal loop so its kind of opaque but this
seems to still match some very long URLs. The test case in question was
a 169K character line (which is now rejected).
2026-03-04 21:09:10 -08:00
Mitchell Hashimoto
3dde6e2559 terminal: bound link regex search work with Oniguruma retry limits
Fixes #11177

Use per-search Oniguruma match params (retry_limit_in_search) in
StringMap-backed link detection to avoid pathological backtracking hangs
on very long lines.

The units are ticks in the internal loop so its kind of opaque but
this seems to still match some very long URLs. The test case in question
was a 169K character line (which is now rejected).
2026-03-04 21:02:55 -08:00
Jeffrey C. Ollie
320d9c2f1c Fix Windows test in src/Command.zig (#11180)
This was introduced in #10611. This doesn't fix all of the current
Windows build problems, but at least fixes one that I introduced.
2026-03-04 22:50:00 -06:00
Jeffrey C. Ollie
961bf46884 Fix Windows test in src/Command.zig
This was introduced in #10611. This doesn't fix all of the current
Windows build problems, but at least fixes one that I introduced.
2026-03-04 22:35:58 -06:00
ghostty-vouch[bot]
a5327a51f3 Update VOUCHED list (#11179)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/11164#discussioncomment-16005149)
from @mitchellh.

Vouch: @Michielvk

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-05 04:34:36 +00:00
ghostty-vouch[bot]
dfa968d932 Update VOUCHED list (#11176)
Triggered by
[comment](https://github.com/ghostty-org/ghostty/issues/11175#issuecomment-4001807388)
from @jcollie.

Vouch: @douglas

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-05 03:07:05 +00:00
Anh Thang
e2a01beca7 Merge branch 'main' into vi_VN 2026-03-05 08:56:57 +07:00
Mitchell Hashimoto
46522a8779 gtk: +new-window now respects --working-directory and -e (#10809)
Fixes: #8862
Fixes: #10716

This adds the machinery to pass configuration settings received over
DBus down to the GObject Surface so that that configuration information
can be used to override some settings from the current "live" config
when creating a new window. Currently it's only possible to override
`--working-directory`, `--command`, and `--title`. `-e` on the `ghostty
+new-window` CLI works as well.

Adding more overridable settings is possible, but being able to fully
override any possible setting would better be served with a major revamp
of how Ghostty handles configs, which is way out of scope at the moment.
2026-03-04 15:09:58 -08:00
Mitchell Hashimoto
436a11dd59 apprt/gtk: reduce split-tree flicker by reusing leaf widgets (#11170)
Fixes #8208

Split-tree updates currently clear `tree_bin` and then wait for every
surface to become parentless before rebuilding. That leaves the split
area blank for one or more frames, which is the visible flicker during
split create/close/ resize/equalize actions.

Keep the previous widget tree attached until the idle rebuild runs, then
swap in the rebuilt tree in one step. During rebuild, reuse existing
leaf widgets by detaching and reparenting them into the new `GtkPaned`
hierarchy instead of recreating wrappers for every leaf.

This removes the parent-settling rebuild path and avoids transient blank
frames while preserving debounced rebuild behavior.
2026-03-04 15:02:04 -08:00
Mitchell Hashimoto
58d6021ec4 apprt/gtk: reduce split-tree flicker by reusing leaf widgets
Fixes #8208

Split-tree updates currently clear `tree_bin` and then wait for every surface
to become parentless before rebuilding. That leaves the split area blank for
one or more frames, which is the visible flicker during split create/close/
resize/equalize actions.

Keep the previous widget tree attached until the idle rebuild runs, then
swap in the rebuilt tree in one step. During rebuild, reuse existing
leaf widgets by detaching and reparenting them into the new `GtkPaned` 
hierarchy instead of recreating wrappers for every leaf.

This removes the parent-settling rebuild path and avoids transient blank
frames while preserving debounced rebuild behavior.
2026-03-04 14:56:51 -08:00
Jeffrey C. Ollie
5bc5820f32 gtk: simplify new-window action memory management with an arena 2026-03-04 16:01:12 -06:00
Mitchell Hashimoto
2cfc9d36d8 Revert "build: link to the system FontConfig by default (#11169)
This reverts commit ee4c6f88c5.

This breaks standard `zig build run` from a dev shell in Nix/NixOS. I
think we need to rethink some of the protections here, possibly only to
apply to packaging/release modes or something.

cc @jcollie
2026-03-04 13:47:48 -08:00
Mitchell Hashimoto
57d877a0d6 Revert "build: link to the system FontConfig by default on non-macOS systems"
This reverts commit 89f9dd7848.
2026-03-04 13:45:41 -08:00
Mitchell Hashimoto
05807f0d72 Revert "build: link to the system FontConfig by default on non-macOS systems (#11152)"
This reverts commit ee4c6f88c5.
2026-03-04 13:44:05 -08:00
Jeffrey C. Ollie
e27956fdde gtk: remove modifications to the core for overrides 2026-03-04 14:04:07 -06:00
Jeffrey C. Ollie
002a6cc765 gtk: use simpler method for passing overrides around
As discussed in Discord, this commit drops the `ConfigOverride` object
in favor of a simpler method of passing the overrides around. Completely
avoiding changes to the core wasn't possible but it's very minimal now.
2026-03-04 14:04:07 -06:00
Jeffrey C. Ollie
f2ce7c348e gtk: +new-window document --title 2026-03-04 14:04:07 -06:00
Jeffrey C. Ollie
ec0f9ef416 gtk: +new-window now respects --title 2026-03-04 14:04:07 -06:00
Jeffrey C. Ollie
6961c2265e gtk: +new-window now respects --working-directory and -e
Fixes: #8862
Fixes: #10716

This adds the machinery to pass configuration settings received over
DBus down to the GObject Surface so that that configuration information
can be used to override some settings from the current "live" config
when creating a new window. Currently it's only possible to override
`--working-directory` and `--command`. `-e` on the `ghostty +new-window`
CLI works as well.

Adding more overridable settings is possible, but being able to fully
override any possible setting would better be served with a major
revamp of how Ghostty handles configs, which I is way out of scope at
the moment.
2026-03-04 14:04:06 -06:00
Mitchell Hashimoto
c3febabd28 apprt: unify split-click focus behavior across macOS and GTK; suppress focus-transfer mouse events (#11167)
## Summary

This PR aligns split-pane click behavior across macOS and GTK when focus
changes due to click.

When a left-click is used to transfer focus (window activation or
switching to another split), Ghostty now treats that click as focus-only
and suppresses forwarding mouse press/release events for that
focus-transfer click.

## Changes

1. macOS: suppress focus-transfer left mouse-down and matching mouse-up
in `SurfaceView_AppKit.swift`.
1. GTK: suppress focus-transfer left mouse-down and matching mouse-up in
`src/apprt/gtk/class/surface.zig`.
1. macOS: defer key-window focus sync to next runloop tick to reduce
transient focus churn in `BaseTerminalController.swift`.
1. macOS build/lint: exclude generated/dependency paths from SwiftLint
during build in `.swiftlint.yml` and
`Ghostty.xcodeproj/project.pbxproj`.

## Behavior

1. Focus-transfer split clicks are now focus-only on both macOS and GTK.
1. Matching release is also suppressed for those clicks, avoiding
release-without-press sequences.
1. Platform behavior is consistent for split focus transitions.

## Validation

1. Built macOS target with `xcodebuild -target Ghostty -configuration
Debug -arch arm64`.
1. Ran targeted Zig test command `zig build test
-Dtest-filter=computeFraction`.
1. Ran format/lint for touched files (`swiftlint lint --fix`, `zig
fmt`).
4. Build and (human) tested click scenarios on macOS

## AI Disclosure

AI-assisted.

Thread:
https://ampcode.com/threads/T-019cb9fe-b11b-753f-99e7-8ecc52b73ec4
2026-03-04 11:11:36 -08:00
Mitchell Hashimoto
226d0b9918 zsh: fix extra newlines with leading-newline prompts (#11166)
In our multiline prompt logic, skip the newline immediately after the
first mark to avoid introducing a double newline due to OSC 133;A's
fresh-line behavior.

Fixes: #11003
2026-03-04 11:09:10 -08:00
Mitchell Hashimoto
3bcf329c2b zsh: emit missing prompt markers in line-init (#11165)
Emit semantic prompt markers at line-init if PS1 doesn't contain our
marks. This ensures the terminal sees prompt markers even if another
plugin (like zinit or oh-my-posh) regenerated PS1 after our precmd ran.
We use 133;P instead of 133;A to avoid fresh-line behavior which would
disrupt the display since the prompt has already been drawn. We also
emit 133;B to mark the input area, which is needed for click-to-move.

Fixes: #10572, #10555
2026-03-04 11:08:58 -08:00
Tim Culverhouse
d1468086ef macos: defer key-window focus sync to reduce churn
Amp-Thread-ID: https://ampcode.com/threads/T-019cb9fe-b11b-753f-99e7-8ecc52b73ec4
Co-authored-by: Amp <amp@ampcode.com>
2026-03-04 12:43:51 -06:00
Tim Culverhouse
0fa12f8915 gtk: suppress mouse reports on focus-transfer clicks
Amp-Thread-ID: https://ampcode.com/threads/T-019cb9fe-b11b-753f-99e7-8ecc52b73ec4
Co-authored-by: Amp <amp@ampcode.com>
2026-03-04 12:43:51 -06:00
Tim Culverhouse
3ee8ef4f65 macos: suppress split-focus click mouse reports
Amp-Thread-ID: https://ampcode.com/threads/T-019cb9fe-b11b-753f-99e7-8ecc52b73ec4
Co-authored-by: Amp <amp@ampcode.com>
2026-03-04 12:43:51 -06:00
Kat
0797b281ec Add Kazakh translation (#10670)
Dear maintainers,

This PR adds Kazakh language translation file and necessary edits to
CODEOWNERS and i18n file with the list of locales.

Please review (and squash when committing)

Thank you!
2026-03-04 18:34:51 +00:00
Jon Parise
9386fa6499 zsh: emit missing prompt markers in line-init
Emit semantic prompt markers at line-init if PS1 doesn't contain our
marks. This ensures the terminal sees prompt markers even if another
plugin (like zinit or oh-my-posh) regenerated PS1 after our precmd ran.
We use 133;P instead of 133;A to avoid fresh-line behavior which would
disrupt the display since the prompt has already been drawn. We also
emit 133;B to mark the input area, which is needed for click-to-move.

Fixes: #10555
2026-03-04 12:48:02 -05:00
Jon Parise
9a3dbe10b0 zsh: fix extra newlines with leading-newline prompts
In our multiline prompt logic, skip the newline immediately after the
first mark to avoid introducing a double newline due to OSC 133;A's
fresh-line behavior.

Fixes: #11003
2026-03-04 12:47:05 -05:00
Michielvk
e07aefa601 fix: zsh shell integration when sudo and ssh aliases are defined 2026-03-04 18:22:29 +01:00
Baurzhan Muftakhidinov
2772c90885 i18n: add Kazakh translation (kk) 2026-03-04 22:02:37 +05:00
Mitchell Hashimoto
53ef42266a macos: Ghostty.Shell.escape unit tests (#11162)
*AI Disclosure:* These were written using the Claude Agent in Xcode
26.3, partly as an excuse to try out that latest integration.
2026-03-04 08:12:15 -08:00
Jon Parise
a716b9c4d4 macos: Ghostty.Shell.escape unit tests 2026-03-04 11:00:03 -05:00
Mitchell Hashimoto
619e33a4fe macos: implement audio bell support with bell-audio-path (#11154)
## Summary

This extends the macOS bell implementation to support the `audio` bell
feature, bringing it to parity with GTK/Linux.

Previously, macOS only had the `system` feature (`NSSound.beep()`). This
PR adds:

- **`audio` bell feature on macOS**: plays the file at `bell-audio-path`
using `NSSound(contentsOfFile:)`, respecting `bell-audio-volume`
- **`cval()` on the `Path` type**: allows `Path` values (a union type)
to be returned through the C API, which is needed for Swift to read
`bell-audio-path`
- **Removes `(GTK only)` restriction** from `bell-audio-path` and
`bell-audio-volume` documentation

## How it works

In `AppDelegate.swift`, when the bell rings and the `audio` feature is
enabled, Ghostty now:
1. Reads `bell-audio-path` from config
2. Loads it as an `NSSound`
3. Applies `bell-audio-volume` and plays it

Falls back gracefully if the path is not set or the file cannot be
loaded.

## Example config

```
bell-features = audio
bell-audio-path = /System/Library/Sounds/Glass.aiff
bell-audio-volume = 0.8
```

## Testing

- Set `bell-features = audio` and `bell-audio-path` to any valid audio
file
- Trigger a bell with `echo -e '\a'`
- Audio should play at the configured volume
2026-03-03 20:08:04 -08:00
Mitchell Hashimoto
98ad1d955c use proper type for optional path 2026-03-03 19:53:15 -08:00
Anh Thang Bui
4d30d886c6 update translation 2026-03-04 09:39:48 +07:00
Anh Thang Bui
2fe55152ca i18n: add Vietnamese translation 2026-03-04 09:28:12 +07:00
Jeffrey C. Ollie
73ce40c623 build(deps): bump cachix/install-nix-action from 31.9.1 to 31.10.0 (#11157)
Bumps
[cachix/install-nix-action](https://github.com/cachix/install-nix-action)
from 31.9.1 to 31.10.0.
<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.0</h2>
<h2>What's Changed</h2>
<ul>
<li>nix: 2.33.3 -&gt; 2.34.0 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/267">cachix/install-nix-action#267</a>
Release notes: <a
href="https://discourse.nixos.org/t/nix-2-34-0-released/75818">https://discourse.nixos.org/t/nix-2-34-0-released/75818</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/cachix/install-nix-action/compare/v31.9.1...v31.10.0">https://github.com/cachix/install-nix-action/compare/v31.9.1...v31.10.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="19effe9fe7"><code>19effe9</code></a>
Merge pull request <a
href="https://redirect.github.com/cachix/install-nix-action/issues/267">#267</a>
from cachix/create-pull-request/patch</li>
<li><a
href="d3f3b99dd1"><code>d3f3b99</code></a>
nix: 2.33.3 -&gt; 2.34.0</li>
<li>See full diff in <a
href="2126ae7fc5...19effe9fe7">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.9.1&new-version=31.10.0)](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-03-03 20:18:08 -06:00