Commit Graph

9305 Commits

Author SHA1 Message Date
David Matos
fae304105b fix typo and add ellipsis for title 2026-01-25 11:15:56 +01:00
David Matos
ed8027a976 Add context menu tab 2026-01-25 01:28:36 +01:00
Mitchell Hashimoto
c9e60b322b terminal: OSC133 options parse from raw string
This changes our OSC133 parser to parse options lazily. We do this for
multiple reasons:

1. Parsing all our options ahead of time balloons our required
   osc.Command tagged union type which has C ABI implications. Adding
   all supported options (including Kitty extensions) today already
   breaks our C ABI.

2. Invalid options are allowed by the specification and should be 
   explicitly ignored, so we don't need to validate options at all
   during parse time.

3. Semantic prompt markers don't need to be high throughput, so we
   can afford to do some extra work at processing time to gather
   the options. They're also rather short usually.
2026-01-24 13:48:31 -08:00
Mitchell Hashimoto
f479210daf Rewrite semantic prompt parsing, parse the full spec (#10427)
Related to #5932 

This updates our OSC parser to parse the full OSC 133 specification:
https://gitlab.freedesktop.org/Per_Bothner/specifications/blob/master/proposals/semantic-prompts.md

The logic for handling these events was _unchanged_ from our prior
implementation. This is just a parser-only update. As such, we ignore a
bunch of semantic prompt command we should definitely handle, and
incorrectly handle others. This is the crux of #5932 that I want to head
towards fixing. This PR just contains the parser updates.

I also retained all the Kitty parser extensions.

**AI disclosure:** AI helped a lot of the rote tasks once I manually did
a few. I'm still reviewing this manually but will do so shortly.
2026-01-24 07:04:04 -08:00
Jeffrey C. Ollie
50d9e03424 core/gtk: add language config entry to override GUI localization
Fixes #10276
2026-01-23 17:22:59 -06:00
Mitchell Hashimoto
c98e3e6fc7 terminal/osc: rename the prompt2 file 2026-01-23 14:38:28 -08:00
Mitchell Hashimoto
afea12116d terminal/osc: Kitty extensions to semantic prompt options 2026-01-23 14:38:06 -08:00
Mitchell Hashimoto
d23722dbd7 terminal: remove old semantic prompt handling 2026-01-23 14:35:10 -08:00
Mitchell Hashimoto
389439b167 terminal: handle semantic prompt same as old 2026-01-23 14:30:27 -08:00
Mitchell Hashimoto
6ce45fb65a terminal/osc: semantic prompt redraw option from Kitty 2026-01-23 14:19:43 -08:00
Mitchell Hashimoto
9f2808ce40 terminal: stream handles new SemanticPrompt type 2026-01-23 14:14:28 -08:00
Mitchell Hashimoto
edafe86203 terminal/osc: semantic prompt is a struct not tagged union 2026-01-23 14:04:27 -08:00
Mitchell Hashimoto
a9e23c135f terminal/osc: semantic prompt 'D' 2026-01-23 13:56:29 -08:00
Mitchell Hashimoto
9d1282eb95 terminal/osc: semantic prompt 'C' 2026-01-23 13:44:34 -08:00
Mitchell Hashimoto
7421e78f1e terminal/osc: semantic prompt 'I' 2026-01-23 13:43:08 -08:00
Mitchell Hashimoto
fdc6a6b10a terminal/osc: semantic prompt 'B' 2026-01-23 13:39:33 -08:00
Mitchell Hashimoto
0d9216bb5a terminal/osc: semantic prompt 'N' 2026-01-23 13:37:34 -08:00
Mitchell Hashimoto
39c0f79b8d terminal/osc: semantic prompt 'P' 2026-01-23 13:35:16 -08:00
Mitchell Hashimoto
7968358234 terminal/osc: semantic prompt options 2026-01-23 13:26:45 -08:00
Mitchell Hashimoto
65c56c7c77 terminal/osc: add 'A' 2026-01-23 13:19:11 -08:00
Mitchell Hashimoto
d040c935e2 terminal/osc: boilerplate new OSC 133 parsing 2026-01-23 13:02:23 -08:00
Jeffrey C. Ollie
f0b4e86ab5 gtk: add read-only indicator for surfaces
Fixes: #9889
2026-01-23 12:11:48 -06:00
Jacob Sandlund
3b75d25e6c fix typo 2026-01-23 08:48:16 -05:00
Jacob Sandlund
2c32e167fe Merge remote-tracking branch 'upstream/main' into harfbuzz-positions 2026-01-23 08:47:55 -05:00
Jeffrey C. Ollie
e1b82ff398 osc: parse iTerm2 OSC 1337 extensions
Add a framework for parsing iTerm2's OSC 1337 extensions. Implement
a couple (`Copy` and `CurrentDir`) that map easily onto existing OSC
commands.
2026-01-22 22:06:39 -06:00
Mitchell Hashimoto
338c9b15aa splits: make resize_split and toggle_split_zoom non-performable with single pane (#10376)
Refer to discussion #10000 

When a tab contains only a single split, resize_split and
toggle_split_zoom actions now return false (not performed). This allows
keybindings marked with `performable: true` to pass the event through to
the terminal program.

The performable flag causes unperformed actions to be treated as if the
binding didn't exist, so the key event is sent to the terminal instead
of being consumed.

- Add isSplit() helper to SplitTree to detect single-pane vs split state
- Update GTK resizeSplit/toggleSplitZoom to return false when single
pane
- Update macOS resizeSplit/toggleSplitZoom to return Bool and check
isSplit
- Add unit test for isSplit method
2026-01-22 08:23:57 -08:00
David Matos
d03b07415d remove comment 2026-01-22 12:06:39 +01:00
David Matos
c755720e17 Merge pot files 2026-01-22 12:00:53 +01:00
Mitchell Hashimoto
01f1611c9f tripwire: change backing store from ArrayHashMap to EnumMap
This eliminates all allocation from Tripwire.
2026-01-21 15:30:49 -08:00
Mitchell Hashimoto
fbc1e326d6 Introduce Tripwire to test errdefer and fix some found issues (#10401)
This adds a new single-file library called "Tripwire" in
`src/tripwire.zig`. This library helps inject failures around `try`
cases for the purpose of testing `errdefer`. It is fully optimized away
in non-test builds (even debug), turning into zero space and zero
assembly.

From this, I've verified (via unit tests w/ tripwire) and fixed a number
of errdefer issues:

* PageList init with non-standard pages that requires more than 1 page
can leak on allocation error on the 2nd+ loop
* Tabstop allocation failure on resize corrupts the internal state
(invalid cols)
* `Screen.selectionString` would leak memory on late allocation failures
* Screen search could leak memory on late allocation failures
* `SharedGrid.renderGlyph` in our font subsystem would corrupt the glyph
cache if failure occurred
* `SharedGrid.init` could leak memory if loading font metrics failed

In addition to the bugs found, there is now tripwire coverage around
more of our core and we should continue to add more. I've also added
significantly more explicit error sets as I found them.

**AI disclosure:** AI wrote some of the tests, but tripwire itself is
all handwritten and everything was reviewed.
2026-01-21 12:50:55 -08:00
Mitchell Hashimoto
3fdff49a82 font: fix memory leak in SharedGrid.init on late failure
Add errdefer cleanup for codepoints and glyphs hash maps in init().
Previously, if ensureTotalCapacity or reloadMetrics() failed after
allocating these maps, they would leak.

Add tripwire test to verify all failure points in init().
2026-01-21 12:37:21 -08:00
Mitchell Hashimoto
b606b71cda font: fix missing errdefer rollback in SharedGrid.renderGlyph
Add errdefer to remove cache entry after getOrPut if subsequent
operations fail (getPresentation, atlas.grow, renderGlyph). Without
this, failed renders would leave uninitialized/garbage entries in
the glyph cache, potentially causing crashes or incorrect rendering.

Add tripwire test to verify the rollback behavior.
2026-01-21 12:23:28 -08:00
Mitchell Hashimoto
64ccad3a75 terminal: fix memory leak on error handling in screen search 2026-01-21 12:01:59 -08:00
Mitchell Hashimoto
c1b22a8041 terminal: fix leak on error in selectionString 2026-01-21 11:53:25 -08:00
Mitchell Hashimoto
a83bd6a111 font: add tripwire tests to Atlas 2026-01-21 11:34:59 -08:00
Mitchell Hashimoto
82b10ae7af terminal: explicit error sets in Screen and ScreenSet 2026-01-21 11:34:59 -08:00
Jeffrey C. Ollie
9ee27d2697 OSC 9: Finish parsing all ConEmu OSCs
Adds support for parsing OSC 9;7, 9;8, 9;9, 9;10, 9;11, 9;12
2026-01-21 13:34:30 -06:00
Mitchell Hashimoto
3d2152f5e8 terminal: Tabstops fix state corruption on error in resize 2026-01-21 09:50:53 -08:00
Mitchell Hashimoto
baa9dd6b2a terminal: use tripwire with PageList init, fix an errdefer bug 2026-01-21 09:42:31 -08:00
Mitchell Hashimoto
179a9d4cfa tripwire: a module for injecting failures to test errdefer 2026-01-21 09:39:02 -08:00
David Matos
4f0f464fb3 Merge branch 'main' into localize-nautilus-script 2026-01-21 14:28:01 +01:00
Steven Lu
ba16ce0249 reintroduce assertion, with adjusted limit 2026-01-21 20:03:37 +07:00
David Matos
0a2b90ed64 Expand Readme to reflect new changes 2026-01-21 13:31:08 +01:00
David Matos
b87e8d8172 Update to new nu ssh ghostty integration 2026-01-21 13:19:53 +01:00
David Matos
6d1125951e Merge branch 'main' into nu-ssh-support 2026-01-21 09:06:42 +01:00
Mitchell Hashimoto
6ec2bfe288 renderer: kitty graphics prep can't fail (skip failed conversions) 2026-01-20 12:29:10 -08:00
Mitchell Hashimoto
d235c490e9 renderer: handle rebuildCells failures gracefully 2026-01-20 12:13:30 -08:00
Mitchell Hashimoto
db092ac3ce renderer: extract rebuildRow to its own function 2026-01-20 12:07:42 -08:00
Mitchell Hashimoto
112363c4e1 font: Collection.getEntry explicit error set 2026-01-20 11:57:22 -08:00
Mitchell Hashimoto
e875b453b7 font/shaper: hook functions can't fail 2026-01-20 11:51:01 -08:00