Commit Graph

17626 Commits

Author SHA1 Message Date
Mitchell Hashimoto
76d9fcefef libghostty: set the search needle via ghostty_search_set, drop GhosttySearchOptions 2026-08-31 14:08:07 -07:00
Mitchell Hashimoto
674abd8a19 example: add c-vt-search demonstrating the terminal search C API 2026-08-31 13:49:55 -07:00
Mitchell Hashimoto
f9202919f7 libghostty: add ghostty_search_* terminal search C API 2026-08-31 13:49:25 -07:00
Mitchell Hashimoto
f0c918fc4b terminal/c: allow freeing a search and its terminal in any order 2026-08-31 13:48:56 -07:00
Mitchell Hashimoto
32601cd79a terminal/c: add search wrapper implementing the whole-terminal search API 2026-08-31 13:20:51 -07:00
Mitchell Hashimoto
149c9f562a terminal: extract whole-terminal search orchestration from the search thread 2026-08-31 13:19:14 -07:00
Mitchell Hashimoto
c2906398be terminal: fix living item over-count in RefCountedSet.addWithId (#14081)
Reported in https://github.com/ghostty-org/ghostty/discussions/14064

I validated this myself manually. The zero-ref branch of
`addWithIdContext` incremented `living` unconditionally even if `upsert`
resolved the value to an item that was already alive under a different
ID.

This would cause `living` to be invalid for each time this happened and
the downstream effect was that `count()` drifted. I couldn't find any
crashing or invalid effect except that this caused requested style
memory to be over-provisioned.

cc @qwerasd205 since its ref counted set, but I did this work manually
❤️
2026-08-31 10:14:12 -07:00
Mitchell Hashimoto
f6113ea2f5 Implement needed modifications for issue #12600, more flexible copy-on-select and middle-click-action (#12604)
For middle-click-action
* Kept the option "primary-paste" instead of "paste-primary" to keep
backwards compatibility
* Added the option "clipboard-paste"

For copy-on-select
* Added the both, none and primary options

Updated config documentation

Note: No AI was used, Even though I don't know Zig, I looked at the code
and the modifications seemed easy enough

Closes #12600
2026-08-31 10:14:02 -07:00
trag1c
d4d8f62262 i18n: adjust and extend Ukrainian translation (#13854) 2026-08-31 15:06:53 +02:00
Mohammad H. AlShami
e80ce2ed4c Fix build error 2026-08-31 15:07:11 +03:00
Mohammad H. AlShami
dfccdb2d4d Implement needed modifications for issue #12600
For middle-click-action
* Kept the option "primary-paste" instead of "paste-primary" to keep
backwards compatibility
* Added the option "clipboard-paste"

For copy-on-select
* Added the both, none and primary options

Updated config documentation

Run zig fmt

Move true/false options for copy-on-select to the compatibility handler

Update src/config/Config.zig

Co-authored-by: kat <65649991+00-kat@users.noreply.github.com>

Update src/config/Config.zig

Co-authored-by: kat <65649991+00-kat@users.noreply.github.com>

Update src/config/Config.zig

Co-authored-by: kat <65649991+00-kat@users.noreply.github.com>

Update src/config/Config.zig

Co-authored-by: kat <65649991+00-kat@users.noreply.github.com>

Update src/config/Config.zig

Co-authored-by: kat <65649991+00-kat@users.noreply.github.com>

Update src/config/Config.zig

Co-authored-by: kat <65649991+00-kat@users.noreply.github.com>

Update src/Surface.zig

Co-authored-by: kat <65649991+00-kat@users.noreply.github.com>

Update src/Surface.zig

Co-authored-by: kat <65649991+00-kat@users.noreply.github.com>

Update src/config/Config.zig

Co-authored-by: kat <65649991+00-kat@users.noreply.github.com>

Update src/config/Config.zig

Co-authored-by: kat <65649991+00-kat@users.noreply.github.com>

Update src/config/Config.zig

Co-authored-by: kat <65649991+00-kat@users.noreply.github.com>

Update src/config/Config.zig

Co-authored-by: kat <65649991+00-kat@users.noreply.github.com>

Update src/config/Config.zig

Co-authored-by: kat <65649991+00-kat@users.noreply.github.com>

Update src/Surface.zig

Co-authored-by: kat <65649991+00-kat@users.noreply.github.com>

Update src/Surface.zig

Co-authored-by: kat <65649991+00-kat@users.noreply.github.com>

Reorder switch items

Apply comment from kat

Remove redundent code
2026-08-31 10:28:47 +03:00
Mohammad AlShami
0254a7f06f Merge branch 'ghostty-org:main' into main 2026-08-31 10:28:47 +03:00
ghostty-vouch[bot]
e8aa098674 Update VOUCHED list (#14092)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/14091#discussioncomment-18212381)
from @pluiedev.

Denounce: @thomas-trijindev

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-31 03:00:47 +00:00
ghostty-vouch[bot]
ec3e384d2d Sync CODEOWNERS vouch list (#14090)
Sync CODEOWNERS owners with vouch list.

## Added Users

- @jakeriksen
- @Kleshzz

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-31 00:01:05 +00:00
Mohammad AlShami
0dc2032e6a Merge branch 'ghostty-org:main' into main 2026-08-31 01:40:26 +03:00
Mitchell Hashimoto
7fd93e09ca build: update Sparkle to 2.9.6 and pin SPM (#14082) 2026-08-30 13:55:20 -07:00
Mohammad AlShami
abac4c2cb8 Merge branch 'ghostty-org:main' into main 2026-08-30 17:52:18 +03:00
Jeffrey C. Ollie
8af6897c0a gtk: do not warn when gtk-xft-dpi is -1 (#14085)
Before this change, ghostty frequently logs the following warning, even
though a `gtk-xft-dpi` value of `-1` is valid and indicates default
scaling.

```
warning(gtk_ghostty_surface): gtk-xft-dpi has invalid value (-1), using default
```

From [the gtk
docs](https://docs.gtk.org/gtk4/property.Settings.gtk-xft-dpi.html):

> The font resolution, in 1024 * dots/inch.
>
> -1 to use the default value.
2026-08-30 04:11:12 -05:00
Michael Sloan
860cfb1d79 Address review feedback 2026-08-30 02:34:21 -06:00
Michael Sloan
3e2c0fa2db gtk: do not warn when gtk-xft-dpi is -1
Before this change, ghostty frequently logs the following warning, even though a `gtk-xft-dpi` value of `-1` is valid and indicates default scaling.

```
warning(gtk_ghostty_surface): gtk-xft-dpi has invalid value (-1), using default
```

From [the gtk docs](https://docs.gtk.org/gtk4/property.Settings.gtk-xft-dpi.html):

> The font resolution, in 1024 * dots/inch.
>
> -1 to use the default value.
2026-08-30 02:21:17 -06:00
ghostty-vouch[bot]
6d850fef77 Update VOUCHED list (#14084)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/14083#discussioncomment-18204946)
from @jcollie.

Vouch: @mgsloan

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-30 08:12:01 +00:00
Lukas
c181983253 build: update Sparkle to 2.9.6 and pin SPM 2026-08-30 10:02:16 +02:00
Mitchell Hashimoto
83c5671577 renderer: vsync unfocused surfaces while dirty (#14068)
A follow on for #14035, we can now fix a long standing
effiency/performance bug now that we park the display link while idle.
This actually could cause "animated" un-focused windows to use more GPU
than their focused counterparts. (AI Agent interfaces seem to love
animation).

6ae1784f4

Unfocused surfaces stopped the CVDisplayLink and encoded a GPU frame on
every PTY wakeup. A burst of close writes became that many Metal submits
instead of one vsync.

Keep the link running while the surface is visible and dirty or
animating, whether or not it is focused. Idle surfaces still park.
2026-08-29 20:07:51 -07:00
Mitchell Hashimoto
ec7929c9c2 terminal/kitty: validate POSIX shared memory names (#14080)
Update shared memory name validation according to the new spec:


22042970cf
2026-08-29 20:04:41 -07:00
Mitchell Hashimoto
5f5495826c terminal: fix living item over-count in RefCountedSet.addWithId
Reported in https://github.com/ghostty-org/ghostty/discussions/14064

I validated this myself manually. The zero-ref branch of `addWithIdContext`
incremented `living` unconditionally even if `upsert` resolved the value
to an item that was already alive under a different ID.

This would cause `living` to be invalid for each time this happened and
the downstream effect was that `count()` drifted. I couldn't find any
crashing or invalid effect except that this caused requested style memory 
to be over-provisioned.
2026-08-29 20:02:42 -07:00
Mitchell Hashimoto
70356472fa build: update Sparkle to 2.9.4 (#14072)
Update the macOS Sparkle dependency from 2.9.0 to 2.9.4.

This keeps the Swift package resolution and all tag/tip release workflow
downloads aligned on the same version. Sparkle 2.9.2 included fixes for
GHSA-g3hp-f6mg-559v and GHSA-hg88-v3cw-3qrh; 2.9.4 is the current stable
release.

Validation:
- verified the 2.9.4 release contains
`Sparkle-for-Swift-Package-Manager.zip`
- verified the lockfile revision matches the 2.9.4 tag
- `jq empty` on `Package.resolved`
- `git diff --check`

I could not run Xcode package resolution locally because the active
developer directory is Command Line Tools rather than a full Xcode
installation.
2026-08-29 19:55:01 -07:00
Mitchell Hashimoto
090fca451d terminal/kitty: validate POSIX shared memory names
Update shared memory name validation according to the new spec:

22042970cf
2026-08-29 19:54:09 -07:00
Mohammad AlShami
81d28beaa2 Merge branch 'ghostty-org:main' into main 2026-08-30 05:40:41 +03:00
ghostty-vouch[bot]
98cd670c0c Update VOUCHED list (#14079)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/14078#discussioncomment-18203195)
from @jcollie.

Vouch: @and-rs

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-30 02:40:12 +00:00
Jeffrey C. Ollie
0a76c31152 Update iTerm2 colorschemes (#14077)
Upstream release:
https://github.com/mbadolato/iTerm2-Color-Schemes/releases/tag/release-20260824-153547-75c93ee
2026-08-29 20:07:36 -05:00
mitchellh
094d175efa deps: Update iTerm2 color schemes 2026-08-30 00:22:34 +00:00
ghostty-vouch[bot]
7b47213f94 Update VOUCHED list (#14074)
Triggered by
[comment](https://github.com/ghostty-org/ghostty/issues/14072#issuecomment-5463405035)
from @bo2themax.

Vouch: @Svector-anu

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-29 15:59:43 +00:00
svector-anu
166d2fe34d build: update Sparkle to 2.9.4 2026-08-29 16:17:24 +01:00
Jeffrey C. Ollie
3baff3a069 main: fix inverted allow_stack_tracing condition (#14069)
The Zig 0.16.0 update dropped the negation from the std default
(!strip_debug_info), disabling stack traces in every unstripped build.

AI disclosure: Claude Fable was used to diagnose the problem and find
the fix. Commit message was written by me.


Claude-Session: https://claude.ai/code/session_01QfzQME46DQXwMWa43bQaa3
2026-08-29 10:00:49 -05:00
Jeffrey C. Ollie
069497e0ca gtk: fix stale pointers to property bindings (#14065)
Fixes #14037 where dragging the surface from a tab with just a single
surface to another tab causes a crash.

The cause of the crash is a stale pointer to the property binding
created in `Surface.bindIsSplit`. When the surface is moved,
`SplitTree.moveSplit` first updates the two split tree data structures
of the source/target tab and then calls `bindIsSplit` to bind the
`is-split` property of the moved surface to the `SplitTree` widget in
the target tab. When `bindIsSplit` is called, the `SplitTree` widget in
the source tab has already been destroyed (because the source tab is now
empty) which causes the old binding to be freed automatically and the
pointer `Surface.is_split_binding` becomes stale. `bindIsSplit` then
tries to run `is_split_binding.unbind()` which causes the crash.

When you create a binding with `bindProperty`, the binding itself owns
the initially created reference and it gets freed when the source or
target object of the binding is finalized. To prevent this, we now
create an extra reference to the binding object so that the Surface
widget owns it and is responsible for freeing it. The binding can still
get severed automatically, but the binding object itself will not be
destroyed. This is the solution mentioned in the [GObject
docs](https://docs.gtk.org/gobject/method.Object.bind_property.html).
Alternatively, using a WeakRef for the pointer would have also worked.

Updated the binding in `SurfaceScrolledWindow` to use the same pattern.
That one was probably fine, because the binding should only be created
once, but it doesn't hurt to be safe.

I reproduced the crash on KDE, on Hyprland I just got a glib critical
error message about the invalid pointer. That probably has to do with
what exactly happens to the freed memory, or maybe differing versions.

#### AI Disclosure

Code and comments were written by myself, used GPT5.6 in researching
gobject binding lifecycles.
2026-08-29 09:36:28 -05:00
Jeffrey C. Ollie
caf48a41ee main: fix inverted allow_stack_tracing condition
The Zig 0.16.0 update dropped the negation from the std default
(!strip_debug_info), disabling stack traces in every unstripped build.

AI disclosure: Claude Fable was used to diagnose the problem and find the
fix. Commit message was written by me.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QfzQME46DQXwMWa43bQaa3
2026-08-29 09:21:14 -05:00
Jesse Miller
97f57edccc renderer: vsync unfocused surfaces while dirty
6ae1784f4

Unfocused surfaces stopped the CVDisplayLink and encoded a GPU
frame on every PTY wakeup. A burst of close writes became that many
Metal submits instead of one vsync.

Keep the link running while the surface is visible and dirty or
animating, whether or not it is focused. Idle surfaces still park.
Focus continues to gate cursor blink, custom-shader animation, and
QoS.
2026-08-29 08:17:09 -06:00
Daniel Kinzler
6cd684d5d3 gtk: fix stale pointers to property bindings
Previously, the property binding created in `Surface.bindIsSplit` would
get freed automatically when the source object (the SplitTree widget)
got finalized. A subsequent call to `bindIsSplit` could then cause a
crash by using the stale pointer to the binding. This bug could e.g. be
triggered by dragging the surface from a single-surface tab to another
tab.

We now create an extra reference to the binding object so that Surface
essentially owns the binding and is responsible for freeing it.

Updated the binding in `SurfaceScrolledWindow` to use the same pattern.
That one was probably fine, because the binding is only created once,
but let's be safe.
2026-08-29 12:15:24 +02:00
Mohammad AlShami
c8c4526e43 Merge branch 'ghostty-org:main' into main 2026-08-29 03:57:39 +03:00
Mitchell Hashimoto
4540d499ae macOS: review windows when closing multiple tabs (#14062)
We can also make close undoable when quitting, i'll add it as a follow
up pr.

<img width="573" height="450" alt="Xnip2026-08-28_19-25-02"
src="https://github.com/user-attachments/assets/3b4f34f4-9ee6-4180-beb7-f90e98c8aa40"
/>
2026-08-28 11:17:55 -07:00
Lukas
777929a8fe macOS: review windows when closing multiple tabs 2026-08-28 19:32:27 +02:00
Mohammad AlShami
58f43d5628 Merge branch 'ghostty-org:main' into main 2026-08-28 15:40:55 +03:00
Mitchell Hashimoto
76e568b475 terminal: mark the previous row dirty when clearing its spacer head (#14054)
Erasing a wrapped wide character at the start of a row (`ECH` or `DCH`)
also clears the spacer head it left at the end of the previous row, but
that row was never marked dirty. With both rows visible, an incremental
render kept the stale spacer head on screen until something unrelated
redrew that row.

The clearing happens in the row-start branch of `splitCellBoundary`.
`clearCells` doesn't do dirty tracking, and both callers only mark the
cursor row, so mark the previous row at the point it's mutated.

The added dirty assertions fail without the fix.

## AI Disclaimer
Claude did the heavy lifting - identifying the root cause, generating
code and description. I reviewed and iterated on it to move around and
tweak tests, comments and reduce verboseness. Verified the end user
visible behaviour improvement with a script that coloured the wide
character, which made the stale rendering visible until a switch to the
alt screen and back cleared it it.
2026-08-27 20:32:12 -07:00
Fredrik Fornwall
eb722cb26d terminal: mark the previous row dirty when clearing its spacer head
Erasing a wrapped wide character at the start of a row (ECH or DCH)
also clears the spacer head it left at the end of the previous row,
but that row was never marked dirty. With both rows visible, an
incremental render kept the stale spacer head on screen until
something unrelated redrew that row.

The clearing happens in the row-start branch of splitCellBoundary.
clearCells doesn't do dirty tracking, and both callers only mark
the cursor row, so mark the previous row at the point it's mutated.

The added dirty assertions fail without the fix.
2026-08-28 02:07:51 +02:00
Mohammad H. AlShami
9af934813a Merge from upstream 2026-08-28 02:13:11 +03:00
trag1c
5aeb693b77 i18n: Russian translation for 1.4 (#13809) 2026-08-28 00:23:17 +02:00
Mitchell Hashimoto
fac595c741 macos: normalize action working directory paths (#14051)
Discussion #14048

Directory URLs no longer export a trailing slash through PWD, which
keeps zsh's %1~ prompt expansion from resolving to an empty string.

A shared URL helper removes trailing separators while preserving the
filesystem root and percent-decoding behavior. Tests cover normal,
repeated, encoded, and root paths.
2026-08-27 15:22:38 -07:00
Mitchell Hashimoto
1c3a4a8314 Update macos/Sources/Helpers/Extensions/URL+Extension.swift
Co-authored-by: Lukas <134181853+bo2themax@users.noreply.github.com>
2026-08-27 14:58:06 -07:00
Mitchell Hashimoto
07abbd1e7e Update macos/Sources/Helpers/Extensions/URL+Extension.swift
Co-authored-by: Lukas <134181853+bo2themax@users.noreply.github.com>
2026-08-27 14:57:59 -07:00
Mitchell Hashimoto
2de1596115 macos: normalize action working directory paths
Discussion #14048

Directory URLs no longer export a trailing slash through PWD, which
keeps zsh's %1~ prompt expansion from resolving to an empty string.

A shared URL helper removes trailing separators while preserving the
filesystem root and percent-decoding behavior. Tests cover normal,
repeated, encoded, and root paths.
2026-08-27 14:35:01 -07:00