202 Commits

Author SHA1 Message Date
Mitchell Hashimoto
a471eaf980 drop a couple function calls and optimize scrolling a bit 2022-11-08 18:35:19 -08:00
Mitchell Hashimoto
306ab947e7 implement region scrolling directly in screen to use memcpy
This doubles scroll region scrolling speed.
2022-11-08 17:35:15 -08:00
Mitchell Hashimoto
c1a9184ebd sgr: parse italic (render not implemented) 2022-11-07 14:04:40 -08:00
Mitchell Hashimoto
79f69885ca update to latest zig which renames @min/@max 2022-10-19 10:42:31 -07:00
Mitchell Hashimoto
b18309187e Strikethrough (#19)
Not as straightforward as it sounds, but not hard either:

* Read OS/2 sfnt tables from TrueType fonts
* Calculate strikethrough position/thickness (prefer font-advertised if possible, calculate if not)
* Plumb the SGR code through the terminal state -- does not increase cell memory size
* Modify the shader to support it

The shaders are getting pretty nasty after this... there's tons of room for improvement. I chose to follow the existing shader style for this to keep it straightforward but will likely soon refactor the shaders.
2022-10-06 15:03:19 -07:00
Mitchell Hashimoto
7bde20a43d a cell is empty only if it also has no styling
Previously we only checked if it had no character. With text shaping,
this was causing runs of only empty backgrounds to not render.
2022-09-13 10:12:44 -07:00
Mitchell Hashimoto
662b656218 implement LRU row GPU cell caching 2022-09-12 11:28:47 -07:00
Mitchell Hashimoto
8995e74e23 rows are dirty when initialized 2022-09-10 11:01:40 -07:00
Mitchell Hashimoto
08b7a866b6 Screen dirty tracking 2022-09-10 10:59:57 -07:00
Mitchell Hashimoto
98dff5a163 better handling of combination characters 2022-09-07 20:10:06 -07:00
Mitchell Hashimoto
85dff335f1 much more accurate run splits and cell widths in runs 2022-09-07 10:30:40 -07:00
Mitchell Hashimoto
3754de3b95 test very long emoji 2022-09-06 14:21:07 -07:00
Mitchell Hashimoto
802f230fa2 handle graphemes with more than 1 joiner 2022-09-05 10:35:22 -07:00
Mitchell Hashimoto
47242ad12a test writing graphemes 2022-09-05 10:29:52 -07:00
Mitchell Hashimoto
7ceff79ea9 various methods on Row are grapheme-aware and tested 2022-09-05 09:47:35 -07:00
Mitchell Hashimoto
b3ec7028fb detect and attach grapheme to grapheme data 2022-09-04 21:57:07 -07:00
Mitchell Hashimoto
a605ff07e1 setup flags, storage for graphemes 2022-09-04 11:17:41 -07:00
Mitchell Hashimoto
e6564dfd11 fix some resize crashes 2022-09-04 09:43:20 -07:00
Mitchell Hashimoto
f417659368 on resize, if rows increasing, handle that first 2022-09-03 22:33:20 -07:00
Mitchell Hashimoto
f3f60e47d1 clearHistory 2022-09-03 21:40:03 -07:00
Mitchell Hashimoto
6373900dfa comment on screen struct 2022-09-03 21:35:43 -07:00
Mitchell Hashimoto
c0e36bedd6 remove dirty for now 2022-09-03 21:26:49 -07:00
Mitchell Hashimoto
3d0ec16ad4 resize with shrinking cols 2022-09-03 21:25:06 -07:00
Mitchell Hashimoto
7134ddec4e resize less rows 2022-09-03 17:59:24 -07:00
Mitchell Hashimoto
1121438d8a maybe clean up resize more cols 2022-09-03 17:50:04 -07:00
Mitchell Hashimoto
d6e243cde1 resize with reflow more cols 2022-09-03 17:28:26 -07:00
Mitchell Hashimoto
2583b8cb65 fix y pos on resize 2022-09-03 12:25:26 -07:00
Mitchell Hashimoto
41f2b756ae fix scrolling and new row calculation 2022-09-03 12:18:45 -07:00
Mitchell Hashimoto
d22a323896 clean up some assertions 2022-09-01 23:25:51 -07:00
Mitchell Hashimoto
8d6e8eb0aa asserts not being optimized away, use comptime gate 2022-09-01 22:21:54 -07:00
Mitchell Hashimoto
57725cf3a4 cache row iterator max value 2022-09-01 22:05:42 -07:00
Mitchell Hashimoto
5aa6d79519 screen: cache history offset
This is a super hot calculation so taking up memory to cache it resulted
in 15m less function calls when catting a 10mb file, and ~5% speedup.
2022-09-01 21:36:59 -07:00
Mitchell Hashimoto
73581eee0b small optimizations 2022-09-01 18:36:27 -07:00
Mitchell Hashimoto
30a14d230e process ASCII events manually to avoid function call overhead 2022-09-01 17:53:40 -07:00
Mitchell Hashimoto
d404be2993 grow our scrollback much faster 2022-09-01 01:15:20 -07:00
Mitchell Hashimoto
dba027d307 resize should maintain minimum of screen rows 2022-09-01 01:09:06 -07:00
Mitchell Hashimoto
77c8ec0a20 the big screen switchover 2022-09-01 00:58:47 -07:00
Mitchell Hashimoto
36140d3ee9 TODO 2022-08-29 20:26:02 -07:00
Mitchell Hashimoto
0505018186 Line segmentation into text runs 2022-08-29 16:39:48 -07:00
Mitchell Hashimoto
65df657b4e make cell attrs bools instead of u1s 2022-08-26 11:09:48 -07:00
Mitchell Hashimoto
46bbab5d10 ignore zero-width characters for now 2022-08-24 13:48:22 -07:00
Mitchell Hashimoto
28072157d5 selection of wide chars and copy/paste works 2022-08-20 17:10:10 -07:00
Mitchell Hashimoto
da79aae0ab terminal: print wide characters 2022-08-20 16:11:48 -07:00
Mitchell Hashimoto
ad1cdbcd59 implement erase display scrollback ("clear" command) 2022-08-09 09:22:34 -07:00
Mitchell Hashimoto
fb5afbedd2 add screen .history tag to fetch scrollback region 2022-08-09 09:18:10 -07:00
Mitchell Hashimoto
38af14ff3a resize alt screen without reflow 2022-08-08 21:14:27 -07:00
Mitchell Hashimoto
f82493cccf when growing cols, adjust viewport and cursor if we shorten 2022-08-08 20:52:36 -07:00
Mitchell Hashimoto
16a5a45293 when growing rows, offset cursor by added rows 2022-08-08 18:14:11 -07:00
Mitchell Hashimoto
d551f1126b when less cols, cursor needs to be in screen space, not viewport 2022-08-08 17:47:16 -07:00
Mitchell Hashimoto
113b5a318b when shrinking rows, clear empty space from the end (see test case) 2022-08-08 17:24:10 -07:00