1357 Commits

Author SHA1 Message Date
Mitchell Hashimoto
3549619a64 terminal: introduce row bit for kitty virtual placeholders 2024-07-25 21:32:45 -07:00
Mitchell Hashimoto
91a6e70d1b terminal/kitty: extra placement tests 2024-07-25 21:32:45 -07:00
Mitchell Hashimoto
1786502f15 terminal/kitty: working runs 2024-07-25 21:32:45 -07:00
Mitchell Hashimoto
cf6463fec0 terminal/kitty: preparing to build runs of placements 2024-07-25 21:32:44 -07:00
Mitchell Hashimoto
7c6ae90300 terminal/kitty: implement high bit image id parsing 2024-07-25 21:32:44 -07:00
Mitchell Hashimoto
578bfc8d23 terminal/kitty: parse image/placement id from style 2024-07-25 21:32:44 -07:00
Mitchell Hashimoto
13df93a1d0 temrinal/kitty: really basic row/col diacritic decoding 2024-07-25 21:32:44 -07:00
Mitchell Hashimoto
e656fe3b79 terminal/kitty: starting virtual placement iterator 2024-07-25 21:32:44 -07:00
Mitchell Hashimoto
deacb10fb1 terminal: print must use codepoint() now to work with placeholders 2024-07-25 21:32:44 -07:00
Mitchell Hashimoto
bb1a9bf532 terminal/kitty: rename diacritics to unicode 2024-07-25 21:32:44 -07:00
Mitchell Hashimoto
f71afcab95 terminal/kitty: diacritic small tests 2024-07-25 21:32:44 -07:00
Mitchell Hashimoto
358b4ca896 terminal/kitty: parse relative placement fields 2024-07-25 21:32:44 -07:00
Mitchell Hashimoto
2c0f9bfc28 terminal: cell returns empty for Kitty placeholder
So we don't render the replacement char
2024-07-25 21:32:44 -07:00
Mitchell Hashimoto
7d9e50353b terminal/kitty: add virtual placeholders placements 2024-07-25 21:32:44 -07:00
Mitchell Hashimoto
a5c382633f terminal/kitty: placements support location enum (only pin for now) 2024-07-25 21:32:43 -07:00
Mitchell Hashimoto
d29073d999 terminal/kitty: add graphics diacritics file 2024-07-25 21:32:43 -07:00
Mitchell Hashimoto
b103e31727 terminal: isBetween needs to fall through for matching y on top page
Regressed in 9198adcba3477ab521cf215f1f652813e32e1951

This was causing Kitty image intersection to break.
2024-07-25 21:32:28 -07:00
Mitchell Hashimoto
902913554b terminal: printing over a cell with the same hyperlink keeps flag
Fixes #1990

This fixes and adds a unit test for an edge case where when printing
over the same cell with the same hyperlink ID, we were unsetting the
cell hyperlink state.

This commit also adds a number of integrity checks to verify hyperlinks
remain in a consistent state.
2024-07-23 16:00:09 -07:00
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
Mitchell Hashimoto
a75ee29f2d Merge pull request #1981 from injust/adjust-line
Add `adjust_selection` actions for `beginning_of_line` and `end_of_line`
2024-07-22 09:40:45 -07:00
Justin Su
64f9327a7d Add unit tests 2024-07-21 23:24:11 -04:00
multifred
72c672adb7 Fix multiple deprecated names for zig lib/std 2024-07-22 00:07:17 +02:00
Justin Su
97bd46de7f Add adjust_selection actions for beginning_of_line and end_of_line 2024-07-20 23:06:47 -04:00
Justin Su
3ad478044b Fix some words 2024-07-20 23:04:24 -04:00
Mitchell Hashimoto
9198adcba3 terminal: Pin.isBetween broken logic
Two bugs:

1. If our pin is the top page, and self.y == top.y, then x will tell us
   the answer. Before, we'd fall through.

2. If our pin is not the top or bottom, but the top == bottom, then we
   can't possibly be between. Before, we'd incorrectly check the linked
   list starting AFTER top.
2024-07-20 14:50:31 -07:00
Mitchell Hashimoto
1eb18895bf Merge pull request #1964 from jparise/osc-133-secondary
terminal: differentiate OSC 133 continuation and secondary kinds
2024-07-18 21:39:23 -07:00
Mitchell Hashimoto
7a50d37bc2 Merge pull request #1962 from jparise/screen-clearprompt-continuation
terminal: test clearPrompt with a continuation
2024-07-18 09:30:26 -07:00
Jon Parise
a4bc98a031 terminal: differentiate OSC 133 continuation and secondary kinds
OSC 133 defines distinct continuation (c) and secondary (s) prompt
kinds. They're both treated as prompt continuations but have different
semantic meanings: `c` allows the user to "go back" and edit previous
lines, while `s` does not.

We don't (yet) handle this "editable" distinction, but this change makes
our OSC parser slightly more correct.
2024-07-18 09:09:00 -04:00
Jon Parise
9369a1a34b terminal: test clearPrompt with a continuation 2024-07-17 20:41:46 -04:00
Mitchell Hashimoto
137ba66211 terminal: implement in-band size reports (Mode 2048)
https://gist.github.com/rockorager/e695fb2924d36b2bcf1fff4a3704bd83
2024-07-17 10:18:15 -07:00
Mitchell Hashimoto
360e4f690f terminal/kitty: change graphics base64 decode to use simdutf 2024-07-16 20:21:09 -07:00
Mitchell Hashimoto
df088c67f4 terminal/tmux: block output notifications 2024-07-12 14:04:56 -07:00
Mitchell Hashimoto
057dc32c71 terminal/tmux: many more notifications 2024-07-12 11:57:37 -07:00
Mitchell Hashimoto
bc7bc15120 terminal/tmux: parse session-changed notification 2024-07-12 10:22:59 -07:00
Mitchell Hashimoto
8c3559ecff terminal: move tmux control mode parsing out to dedicated file 2024-07-12 09:49:59 -07:00
Mitchell Hashimoto
1ea25c5c64 terminal: tmux parsing handles begin/end blocks 2024-07-11 20:53:50 -07:00
Mitchell Hashimoto
f4db5009d6 terminal: dcs state cleanup in deinit 2024-07-11 19:09:55 -07:00
Mitchell Hashimoto
88d055452b terminal: tmux enter/exit 2024-07-11 19:02:33 -07:00
Mitchell Hashimoto
ff43609097 terminal: boilerplate for tmux control mode parsing 2024-07-11 18:58:25 -07:00
Mitchell Hashimoto
f375bf009c terminal: all DCS events can produce a command 2024-07-11 18:53:42 -07:00
Mitchell Hashimoto
01e1538ad3 terminal: dcs put can return a command 2024-07-11 18:42:22 -07:00
Mitchell Hashimoto
38d33a761b terminal: test DCS to make sure we don't regress 2024-07-11 18:34:05 -07:00
Mitchell Hashimoto
c28470e98a terminal: DCS parses params correctly 2024-07-11 18:29:14 -07:00
Mitchell Hashimoto
54034468b7 terminal: remove errdefer deleted call for refcountedset 2024-07-09 09:07:28 -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
10dbca9464 terminal/PageList: fix some incorrect test expectations 2024-07-08 22:29:55 -04:00
Qwerasd
be99e50c50 terminal/PageList: add method for logging debug diagrams 2024-07-08 22:28:16 -04:00
Qwerasd
6f1a2d1e8e terminal/Screen: fix trailing blank cell handling for wrapped rows in dumpString 2024-07-08 22:26:36 -04:00
Qwerasd
730185b212 terminal: spacer heads and tails should be codepoint 0, not ' ' 2024-07-08 22:25:39 -04:00
Qwerasd
0cee115ba3 terminal/page: use addWithIdContext when cloning hyperlink data 2024-07-08 22:22:18 -04:00