Commit Graph

8377 Commits

Author SHA1 Message Date
Everton Correia
60da5eb3a6 Apply suggestion from @pluiedev
Co-authored-by: Leah Amelia Chen <github@acc.pluie.me>
2026-01-16 12:25:49 -03:00
evertonstz
c553296d7a Remove unused import of 'builtin' in gsettings.zig 2026-01-15 19:08:37 -03:00
evertonstz
04a7bcd138 Fix middle button paste condition to respect GNOME settings 2026-01-15 18:20:44 -03:00
evertonstz
db7df92a81 Refactor gsettings usage for gtk-xft-dpi and gtk-enable-primary-paste with improved logging 2026-01-15 18:15:31 -03:00
evertonstz
29adcf4b64 Enhance GTK settings handling with well-defined types and utility functions 2026-01-15 17:16:11 -03:00
Everton Correia
7a306e52c2 Update src/apprt/gtk/class/surface.zig
Co-authored-by: Leah Amelia Chen <github@acc.pluie.me>
2026-01-15 11:49:23 -03:00
evertonstz
78a503491e initial commit 2026-01-15 10:53:00 -03:00
Mitchell Hashimoto
c90f47f11f Terminal: keep cross-boundary rows dirty in {insert,delete}Lines (#10290)
This fixes #10265 and thus also the remaining part of #9718 and likely
#10250.

The issue was that when using `insertLines` and `deleteLines` to
generate scrolling in a region that spans a page boundary, rows that are
replaced by a row from a different page lose their dirty flags in the
clone operation, since the flag is part of the data that gets cloned.
The solution is to set the dirty flag again after the clone, just like
the non-cloning branch does after the pointer swap.

**AI disclosure:** Amp is the MVP here. I prompted it with the
hypothesis I developed in #10265 (that this happens when the scrolling
region spans a page boundary), supplemented with insight I gained from
perusing asciicast files (that the offending scrolling operations are
always triggered by `CSI 1 L` or `CSI 1 M`, that is,
`Terminal.insertLines` or `Terminal.deleteLines`). Amp figured out the
rest and drafted the fix and tests. For free!

I cleaned up the tests and then pushed back a bit against the logic
behind the fix, which led to a better understanding and what I think is
a more appropriate fix. I can explain the details if there's interest,
or people can just skim the thread here:
https://ampcode.com/threads/T-019bb0d6-5334-744a-b78a-7c997ec1fade.
2026-01-12 10:21:36 -08:00
Mitchell Hashimoto
136df4a0f5 nix: update nixpkgs, remove zig.hook, and remove x11-gnome (#10286)
As of NixOS/nixpkgs#473413, `zig.hook` no longer supports
`zig_default_flags`, and now they can and must be provided in
`zigBuildFlags` instead.

Updating also requires removing gnome-xorg since it has been removed
from nixpkgs.

`nix flake check` succeeds on my system (x86_64-linux), with a couple
deprecation warnings that I believe aren't important.
2026-01-12 10:20:59 -08:00
MithicSpirit
2af6e255e4 chore: fix typo curor->cursor (2x)
Detected by CI (typos) after nixpkgs update.
2026-01-12 13:17:05 -05:00
Mitchell Hashimoto
5817e1dc5f terminal: PageList can initialize with memory requirements > std 2026-01-12 09:57:20 -08:00
Daniel Wennberg
257aafb7b4 Consolidate dirty marking in insertLines/deleteLines 2026-01-12 09:49:08 -08:00
Mitchell Hashimoto
7ed19689b9 terminal: add Capacity.maxCols 2026-01-12 08:53:34 -08:00
Daniel Wennberg
095c82910b Terminal: keep cross-boundary rows dirty in {insert,delete}Lines 2026-01-11 23:26:46 -08:00
Daniel Wennberg
87b11e0892 Add failing tests for #10265 2026-01-11 23:25:44 -08:00
Jon Parise
bb1c3bce10 fix(completions.fish): add +help and +version to completions (#10287)
`+help` and `+version` is missing from completions, even though they are
working actions and are referenced in discussion template
[here](https://github.com/ghostty-org/ghostty/pull/7012). This PR adds
the completion for fish (as that is the shell that I use).
2026-01-11 19:45:25 -05:00
Jon Parise
e47272878d extra: enable +help and +version in bash and zsh 2026-01-11 19:26:27 -05:00
Peter Cardenas
2bdbda20fd fix(completions.fish): add +help and +version to completions 2026-01-11 15:29:32 -08:00
Mitchell Hashimoto
b995595953 terminal: tracked pins need to be invalidated for the non-std page
Fixes a regression from #10251

Thanks to @grishy again for finding this. Updated tests to catch it,
too.
2026-01-11 14:25:45 -08:00
Mitchell Hashimoto
24880becb7 terminal: remove the ability to reuse a pool from PageList (#10271)
This was an unused codepath and it complicates some things I'd like to
do, such as resetting our pools during resize. It complicates those
paths because if a user provides a pool we can't reset it (because other
things might be in it). It's best to own the pools. And since we didn't
reuse pools anyway, let's remove that.

Note this was previously used by our old render state mechanism (before
`terminal.RenderState`) as a way for the renderer to speed up clones by
having a preheated pool that was likely the right size before every
frame. Since we changed methods, we don't need it.
2026-01-11 07:23:45 -08:00
Mitchell Hashimoto
6037e2194a terminal: remove the ability to reuse a pool from PageList
This complicates logic and is unused.
2026-01-11 07:18:35 -08:00
rhodes-b
50516ed581 add search selection for GTK 2026-01-10 19:45:05 -06:00
Mitchell Hashimoto
509f073366 terminal: fix up our total row and pin accounting during reuse 2026-01-10 07:11:52 -08:00
Mitchell Hashimoto
235eebfa92 terminal: during test, use the testing allocator for pages 2026-01-10 06:55:24 -08:00
Mitchell Hashimoto
9ee78d82c0 terminal: fix memory leak when grow attempts to reuse non-standard page 2026-01-10 06:49:54 -08:00
Mitchell Hashimoto
1d63045c2f terminal: use tagged memory for PageList ops 2026-01-10 06:39:32 -08:00
Mitchell Hashimoto
b426a68297 os: mach taggedPageAllocator 2026-01-09 20:37:58 -08:00
Mitchell Hashimoto
6f1544b4a3 os: add mach VM tags 2026-01-09 20:23:39 -08:00
Mitchell Hashimoto
ec2912dbaf docs: bell border feature is available on macOS (#10242)
As of commit fe55d90 and PR #8768 this feature is also available on
macOS.
2026-01-09 11:40:12 -08:00
Martin Müller
d94ba5cf10 docs: add bell border feature version availability
Commit 22fc90f (PR #8222) on GTK and commit fe55d90 (PR #8768) on macOS.
2026-01-09 18:46:00 +01:00
Mitchell Hashimoto
0e9ce7e450 input: change our binding set to use array hash map
This is recommended for ongoing performance: 
https://github.com/ziglang/zig/issues/17851

Likely not an issue for this particular use case which is why it never
bit us; we don't actively modify this map much once it is created. But,
its still good hygiene and ArrayHashMap made some of the API usage
nicer.
2026-01-09 09:06:03 -08:00
Mitchell Hashimoto
201198c74a input: do value comparison for Set hash maps
We previously only compared the hashes for triggers and actions for hash
map equality. I'm genuinely surprised this never bit us before because
it can result in false positives when two different values have the same
hash. Fix that up!
2026-01-09 08:59:05 -08:00
Mitchell Hashimoto
c179de62a7 extract deepEqual 2026-01-09 08:59:05 -08:00
Martin Müller
115351db87 docs: bell border feature is available on macOS
As of commit fe55d90 and PR #8768 this feature is also available on
macOS.
2026-01-09 16:19:50 +01:00
Mitchell Hashimoto
856ef1fc1b input: change the key_is_binding to return some information 2026-01-09 06:51:48 -08:00
Mitchell Hashimoto
18535f04d1 osc: refactor parsing helper functions into separate files (#10233)
Following up on #9950, refactor the parsing helper functions into
separate files.
2026-01-09 06:13:35 -08:00
Jeffrey C. Ollie
93b4b08b52 osc: refactor parsing helper functions into separate files
Following up on #9950, refactor the parsing helper functions into
separate files.
2026-01-08 23:07:57 -06:00
Mitchell Hashimoto
5bfbadbc70 terminal/search: screen search prunes history for no-scrollback screens
The big comment in `search/screen.zig` describes the solution well. The
problem is that our search is discrete by page and a page can contain
some amount of history as well. 

For zero-scrollback screens, we need to fully prune any history lines.
For everyone else, everything in the PageList is scrollable and visible
so we should search it.
2026-01-08 20:48:19 -08:00
Mitchell Hashimoto
a692cb9e5f terminal: PageList shouldn't allow any scrolling with max_size=0 (#10229)
Partial #10227

This fixes the scrollbar part of #10227, but not the search part.

The way PageList works is that max_size is advisory: we always allocate
on page boundaries so we always have _some_ extra space (usually, unless
you ask for a byte-perfect max size). Normally this is fine, it doesn't
cause any real issues. And this has been true since Ghostty 1.0.

But with the introduction of scrollbars (and search), we were exposing
this hidden space to the user. To fix this, the easiest approach is to
special-case the zero-scrollback scenario, since it is already
documented that scrollback limit is not _exact_ and is subject to some
minimum allocations. But with zero-scrollback we really expect NOTHING.
2026-01-08 15:57:07 -08:00
Mitchell Hashimoto
794c47425e terminal: PageList shouldn't allow any scrolling with max_size=0
Partial #10227

This fixes the scrollbar part of #10227, but not the search part.

The way PageList works is that max_size is advisory: we always allocate
on page boundaries so we always have _some_ extra space (usually, unless
you ask for a byte-perfect max size). Normally this is fine, it doesn't
cause any real issues.

But with the introduction of scrollbars (and search), we were exposing
this hidden space to the user. To fix this, the easiest approach is to
special-case the zero-scrollback scenario, since it is already
documented that scrollback limit is not _exact_ and is subject to some
minimum allocations. But with zero-scrollback we really expect NOTHING.
2026-01-08 15:52:49 -08:00
Mitchell Hashimoto
caa6b958d7 apprt/embedded: escape the initial input string
Fixes #10214
2026-01-08 14:07:46 -08:00
Jeffrey C. Ollie
f180f1c9b8 osc: remove inline from Parser.next 2026-01-08 14:12:16 -06:00
Jeffrey C. Ollie
6ee1b3998e osc: no defaults on Parser fields 2026-01-08 13:50:44 -06:00
Jeffrey C. Ollie
0b9b17cbe0 osc: remove pub from internal parser functions 2026-01-08 13:50:44 -06:00
Jeffrey C. Ollie
2805c1e405 osc: collapse switch cases 2026-01-08 13:50:44 -06:00
Jeffrey C. Ollie
d32a94a06a core: add new OSC parser
This replaces the OSC parser with one that only uses a state machine to
determine which OSC is being handled, rather than parsing the whole OSC.
Once the OSC command is determined the remainder of the data is stored
in a buffer until the terminator is found. The data is then parsed to
determine the final OSC command.
2026-01-08 13:50:43 -06:00
Jeffrey C. Ollie
fb1268a908 benchmark: add doNotOptimizeAway to OSC benchmark 2026-01-08 13:50:43 -06:00
Mitchell Hashimoto
a6d36b5e6d config: add more details to the key-remap feature 2026-01-08 10:45:45 -08:00
Mitchell Hashimoto
21d9d89d32 input: RemapSet should support aliased mods 2026-01-08 10:26:46 -08:00
Mitchell Hashimoto
5b24aebcab update to use new RemapSet 2026-01-08 10:22:56 -08:00