Mitchell Hashimoto
9a4a138da0
screen: don't wrap empty-char stylized cells on shrinking cols
2023-03-01 17:34:17 -08:00
Mitchell Hashimoto
31ac3ec7ba
screen: when expanding cols, broadcast empty styled cells
2023-03-01 17:24:24 -08:00
Mitchell Hashimoto
89138cf7e3
screen: don't trim blank lines if rows aren't changing
2023-03-01 17:09:57 -08:00
Mitchell Hashimoto
b4d8419feb
screen: trim trailing no-character cells when rows is changing
...
This matches Terminal.app, and makes it so the `ESC [ J` doesn't
generate scrollback on rows change.
2023-03-01 17:07:07 -08:00
Mitchell Hashimoto
d4057522ee
screen: resize more rows preserves soft wrapped flag
2023-03-01 09:18:26 -08:00
Mitchell Hashimoto
5f9ab91466
screen: fix issue with resizing w/ more cols, reflow, and scrollback
2023-03-01 09:08:08 -08:00
Mitchell Hashimoto
1970a84960
screen: when resizing and trimming scrollback, have to offset cursor Y
...
When the scrollback is trimmed off the top, the y stops moving. This
would cause an assertion failure because y could be greater than the row
count! The test case tests this.
2023-02-28 22:28:27 -08:00
Mitchell Hashimoto
87e0f5589f
screen clone should not make full requested height "written"
...
Previously, the screen clone would incidentally mark the full height as
"written" which would cause resize to create scrollback because it was
trying to preserve prior rows. A clone should not "write" any data. This
modifies the clone operation to create a screen with the correct height
but only copy data actually written.
2023-02-28 17:10:28 -08:00
Mitchell Hashimoto
ce86c64b42
update zig, src for loops
2023-02-27 21:46:42 -08:00
Mitchell Hashimoto
4fae29ff13
terminal: scrollRegionUp outside of range does nothing
2022-12-14 21:43:47 -08:00
Mitchell Hashimoto
c7a28fab20
terminal: don't crash if cell claims to have grapheme but doesn't
2022-12-14 21:19:23 -08:00
Mitchell Hashimoto
29cc8312d5
revert
2022-11-27 21:45:10 -08:00
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