Mitchell Hashimoto
4a3376d916
fix crash with cursor going off screen on resize
2022-11-27 21:06:11 -08:00
Mitchell Hashimoto
584149121d
use enum for underline styles
2022-11-27 14:16:51 -08:00
Mitchell Hashimoto
3fbeca914b
terminal: fix possible crash when increasing columns in resize
...
If a cell has graphemes attached to it, we'd share the grapheme map.
This copies it.
2022-11-26 17:44:08 -08:00
Mitchell Hashimoto
d64b0e371e
terminal: copy grapheme map when resizing and ensure proper cleanup
2022-11-26 17:33:52 -08:00
Mitchell Hashimoto
70b017200a
copying selection trims trailing whitespace
...
This is configurable with `clipboard-trim-trailing-spaces`.
This also fixes a bug where debug builds would crash when copying blank
lines. This never affected release builds.
2022-11-22 21:27:05 -08:00
Mitchell Hashimoto
d1b565f4d4
hook up triple-click in UI to select lines
2022-11-22 10:07:52 -08:00
Mitchell Hashimoto
8b839ef4b6
screen selectLine and tests
2022-11-22 10:03:20 -08:00
Mitchell Hashimoto
04088abe5a
fix regression around selecting word at end of screen
2022-11-22 09:41:07 -08:00
Mitchell Hashimoto
a63815c5ba
selectWord goes across soft-wrapped lines
2022-11-22 08:04:27 -08:00
Mitchell Hashimoto
f7c6ea63e1
screen selectWord starting functionality, not done at all
2022-11-21 21:34:38 -08:00
Mitchell Hashimoto
a714ee2702
fix memory leak when grapheme clusters of >4 codepoints are present
2022-11-18 14:15:14 -08:00
Mitchell Hashimoto
69fdd57aa3
screen: support scroll region scrolling with circular buffer wraparound
2022-11-16 09:28:56 -08:00
Mitchell Hashimoto
feccd550c3
implement many more reset sgr attributes
2022-11-13 21:54:26 -08:00
Mitchell Hashimoto
019f1e34bb
metal: copy screen data (see opengl commit for why)
2022-11-13 17:29:23 -08:00
Mitchell Hashimoto
3fcdd9a196
fix outdated test
2022-11-13 16:25:50 -08:00
Mitchell Hashimoto
f1c69343d3
opengl: copy screen data instead of sharing state
...
Through benchmarking I've determined this lowers lock contention by
about 50% on the critical data.
2022-11-13 16:16:08 -08:00
Mitchell Hashimoto
ce85d9a2cd
add more tracing, unroll a loop
2022-11-08 19:15:14 -08:00
Mitchell Hashimoto
d1718e6cbf
use libc memcpy/memmove instead of std.mem if available
2022-11-08 19:01:45 -08:00
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