Mitchell Hashimoto
3b889438aa
terminal: page clone handles case where hyperlink can't dupe
...
Fixes #1991
To check if a hyperlink from another page is already present in our
page's set, we need to dupe the hyperlink struct. If the hyperlink is
already present in our page, this dupe is a waste and is freed.
In the case where the hyperlink is present AND we don't have enough
memory to dupe the hyperlink to check if its present, we'd previous
simply crash out and fail rendering. Debug builds would crash with
integrity errors.
This commit resolves the issue by falling back to a slow path when our
string allocation table is full and iterating over the hyperlink map to
check one by one if we have the hyperlink. This O(N) is much slower than
allocating (in this case) but N is usually low on top of this case being
rare.
A better solution would probably be to ensure we always have some % of
available space free in our string allocation table. This would result
in some wasteful page reallocs but would speed up the render loop. We
can look into that later.
2024-07-22 17:01:25 -07:00
Qwerasd
8589f2c0fb
terminal/PageList: rework reflow logic to fix issues
...
Reflow logic now lives inside of ReflowCursor. This fixes multiple
issues with the previous implementation, and is more straightforward
in how it works. The old impl resulted in fragmentation of pages,
leading to unbounded memory growth when resizing repeatedly.
Also improves the preserved_cursor logic in `resizeCols`.
2024-07-08 22:35:15 -04:00
Qwerasd
0cee115ba3
terminal/page: use addWithIdContext when cloning hyperlink data
2024-07-08 22:22:18 -04:00
Qwerasd
29e6dcdee5
terminal/page: add methods to get hyperlink and grapheme map capacities
2024-07-08 22:20:31 -04:00
Mitchell Hashimoto
a6051b931e
terminal: disable zombie styles integrity check
2024-07-05 21:40:40 -07:00
Mitchell Hashimoto
4f099af76f
terminal: set hyperlink state on clone
2024-07-05 21:40:40 -07:00
Mitchell Hashimoto
b0f99307d3
terminal: pause integrity checks in clone row until done
2024-07-05 21:40:39 -07:00
Mitchell Hashimoto
041c779512
renderer: matchSet matches OSC8
2024-07-05 21:40:39 -07:00
Mitchell Hashimoto
f777e42af2
terminal: page clone needs to clone strings
2024-07-05 21:40:39 -07:00
Mitchell Hashimoto
961a4b6b31
terminal: support page oom with hyperlinks
2024-07-05 21:40:39 -07:00
Mitchell Hashimoto
d7e089e2aa
terminal: simplify hyperlink capacity
2024-07-05 21:40:38 -07:00
Mitchell Hashimoto
365567b3c6
terminal: increase std cap for now until we implement resize
2024-07-05 21:40:38 -07:00
Mitchell Hashimoto
84edaed690
terminal: scrollDown with hyperlinks
2024-07-05 21:40:38 -07:00
Mitchell Hashimoto
bac1307c4b
terminal: index hyperlink tests
2024-07-05 21:40:38 -07:00
Mitchell Hashimoto
57c5522a6b
terminal: handle moving/swapping/clearing cells with hyperlinks
2024-07-05 21:40:38 -07:00
Mitchell Hashimoto
e2133cbd92
terminal: row needs hyperlink state, test clearing hyperlink
2024-07-05 21:40:38 -07:00
Mitchell Hashimoto
a3a445a066
terminal: print sets hyperlink state, tests
2024-07-05 21:40:38 -07:00
Mitchell Hashimoto
2a7755c515
terminal: hyperlink data structures beginning, alloc into page
2024-07-05 21:39:07 -07:00
Mitchell Hashimoto
a71b487d58
terminal: add strings table to page
2024-07-05 21:39:07 -07:00
Mitchell Hashimoto
69705cbced
terminal: remove the hyperlink stuff i'm starting over
2024-07-05 21:39:07 -07:00
Mitchell Hashimoto
75e1655228
terminal: change default hyperlink count to zero
2024-07-05 21:39:07 -07:00
Mitchell Hashimoto
25d1e861ec
terminal: page memory layout for uri/hyperlink data
2024-07-05 21:39:07 -07:00
Qwerasd
93b038f490
fix(RefCountedSet): add NeedsRehash error and fix PSL counting bug
...
Prevent bad input from causing repeated OutOfMemory errors by erroring
with NeedsRehash instead when there are unused dead IDs available.
Additionally, properly decrement PSL stats when reviving dead IDs.
2024-06-24 20:32:22 -07:00
Qwerasd
35793ee7cc
page integrity checks: detect zombie styles
2024-06-24 20:32:22 -07:00
Qwerasd
6f732cca55
RefCountedSet: use usize for cap to allow up to max Id
+1
2024-06-24 20:32:22 -07:00
Mitchell Hashimoto
eebc7d4c3a
small stylistic changes
2024-06-23 09:44:54 -07:00
Qwerasd
9741b3a18c
perf: introduce RefCountedSet structure, use it for Style.Set
2024-06-13 22:59:03 -04:00
Mitchell Hashimoto
7e52f94278
terminal: on clone, only mark rows dirty that were previously dirty
2024-05-01 20:31:49 -07:00
Mitchell Hashimoto
d47f14f86a
terminal: dirty tracking on screen clone
2024-05-01 20:31:49 -07:00
Mitchell Hashimoto
11c195e493
terminal: dirty tracking on print
with tests
2024-05-01 20:31:48 -07:00
Mitchell Hashimoto
7b750b7ed9
terminal: add dirty bits to the page structure
2024-05-01 20:31:48 -07:00
Mitchell Hashimoto
1f09da02ad
terminal: relax cell zero value default test
2024-04-18 14:09:11 -07:00
Mitchell Hashimoto
9ea78f981e
terminal: index (LF) that scrolls scroll region preserves SGR
...
Fixes #1676
The comment in the diff explains. This is a regression that was not unit
tested properly in the old implementation prior to the paged-terminal
merge.
2024-04-13 21:31:41 -07:00
Mitchell Hashimoto
eb2a2e3931
fmt
2024-04-02 08:38:51 -07:00
Qwerasd
d17344b855
perf(terminal/page): @memset micro-optimization
2024-03-26 12:07:35 -06:00
Mitchell Hashimoto
fcc0ea0c7c
terminal: explicit error set for page clone
2024-03-25 20:10:03 -07:00
Mitchell Hashimoto
e337ebe131
terminal: add clonePartialRowFrom
2024-03-25 20:01:28 -07:00
Mitchell Hashimoto
9ee0b23ef7
terminal: clear spacer heads on growing cols w/o reflow
2024-03-25 09:42:05 -07:00
Mitchell Hashimoto
33ede13072
terminal: fix release builds
2024-03-24 21:28:30 -07:00
Mitchell Hashimoto
db3ab4b0c8
terminal: pause page integrity can be nested
2024-03-24 20:57:35 -07:00
Mitchell Hashimoto
36240b897c
terminal: many more assertions around spacer state
2024-03-24 20:27:47 -07:00
Mitchell Hashimoto
f719999950
terminal: add assertion to page integrity that row/col count > 0
2024-03-24 14:46:43 -07:00
Mitchell Hashimoto
eb6536f4a7
address latest zig changes
2024-03-22 20:29:45 -07:00
Mitchell Hashimoto
ee5be26511
terminal: prevent false positive integrity check
2024-03-22 20:28:23 -07:00
Mitchell Hashimoto
0bc831d19f
terminal: relax grapheme integrity check for fast paths
2024-03-22 20:28:22 -07:00
Mitchell Hashimoto
40cac97c86
terminal: insertChars/deleteChars needs to account properly
2024-03-22 20:28:22 -07:00
Mitchell Hashimoto
4c35f35904
terminal: get rid of some verifications, comment why
2024-03-22 20:28:22 -07:00
Mitchell Hashimoto
3b6ae6807c
terminal: add more integrity assertions
2024-03-22 20:28:22 -07:00
Mitchell Hashimoto
1649641d18
terminal: add some integrity assertions
2024-03-22 20:28:22 -07:00
Mitchell Hashimoto
1be06e8f3f
terminal: add page.verifyIntegrity function
2024-03-22 20:28:22 -07:00