477 Commits

Author SHA1 Message Date
Mitchell Hashimoto
f7cba73f57 terminal/new: charsets 2024-03-22 20:27:30 -07:00
Mitchell Hashimoto
116f6264ba terminal/new: erase display complete 2024-03-22 20:27:29 -07:00
Mitchell Hashimoto
f7e2868533 terminal/new: erasedisplay wip 2024-03-22 20:27:29 -07:00
Mitchell Hashimoto
b139cb8597 terminal/new: bring in a bunch more tests 2024-03-22 20:27:28 -07:00
Mitchell Hashimoto
9ad76c6482 terminal/new: eraseLine 2024-03-22 20:27:28 -07:00
Mitchell Hashimoto
fd0ab1a80b terminal/new: save cursor, protected modes 2024-03-22 20:27:28 -07:00
Mitchell Hashimoto
b4ed0e6cbe terminal/new: saved cursor 2024-03-22 20:27:28 -07:00
Mitchell Hashimoto
7fe7c56e2b terminal/new: deleteChars 2024-03-22 20:27:28 -07:00
Mitchell Hashimoto
23b0c1fad9 terminal/new: insertBlanks, insert mode 2024-03-22 20:27:28 -07:00
Mitchell Hashimoto
dfd46a850b terminal/new: decaln 2024-03-22 20:27:28 -07:00
Mitchell Hashimoto
d38e075a7c terminal/new: lots more scroll region tests 2024-03-22 20:27:28 -07:00
Mitchell Hashimoto
1280301c08 terminal/new: left/right margins insertLines 2024-03-22 20:27:27 -07:00
Mitchell Hashimoto
09f8c17800 terminal/new: erase according to bg sgr 2024-03-22 20:27:27 -07:00
Mitchell Hashimoto
d30f50d5f0 terminal/new: cursorRight 2024-03-22 20:27:27 -07:00
Mitchell Hashimoto
a41239fddc terminal/new: cursorDown 2024-03-22 20:27:27 -07:00
Mitchell Hashimoto
14d25a4d82 terminal/new: cursorLeft 2024-03-22 20:27:27 -07:00
Mitchell Hashimoto
805abd4e29 terminal/new: couple missing tests 2024-03-22 20:27:27 -07:00
Mitchell Hashimoto
977f079fdd terminal/new: scrollUp 2024-03-22 20:27:27 -07:00
Mitchell Hashimoto
1a174dbb89 terminal/new: deleteLines 2024-03-22 20:27:26 -07:00
Mitchell Hashimoto
cc324b0cb7 terminal/new: index tests 2024-03-22 20:27:26 -07:00
Mitchell Hashimoto
0cbed73ff0 terminal/new: cursorUp and reverseIndex 2024-03-22 20:27:26 -07:00
Mitchell Hashimoto
d86a47266e terminal/new: one left/right margin test 2024-03-22 20:27:26 -07:00
Mitchell Hashimoto
893770d98d terminal/new: eraseChars 2024-03-22 20:27:26 -07:00
Mitchell Hashimoto
0f63cd6f01 terminal/new: scrollDown, top/bot margin tests, fix insertLines bug 2024-03-22 20:27:26 -07:00
Mitchell Hashimoto
6fb4fddedf terminal/new: insertLines 2024-03-22 20:27:26 -07:00
Mitchell Hashimoto
b053be0164 terminal/new: scrolling viewport 2024-03-22 20:27:26 -07:00
Mitchell Hashimoto
24dab9d01e terminal/new: graphemes 2024-03-22 20:27:25 -07:00
Mitchell Hashimoto
26b1a00380 terminal/new: non-grapheme zwjs 2024-03-22 20:27:25 -07:00
Mitchell Hashimoto
d87a1c694e terminal/new: setcursorpos tests 2024-03-22 20:27:25 -07:00
Mitchell Hashimoto
dd7bb1fab5 terminal/new: backspace, cursor left 2024-03-22 20:27:25 -07:00
Mitchell Hashimoto
4acbf09bb6 terminal/new: CR and LF 2024-03-22 20:27:25 -07:00
Mitchell Hashimoto
d95bde0af7 terminal/new: port many more tests 2024-03-22 20:27:25 -07:00
Mitchell Hashimoto
004405ccf9 terminal: only apply VS15/16 to emoji
Fixes #1482
2024-02-10 17:26:45 -08:00
Mitchell Hashimoto
f7c945c4a7 Merge pull request #1494 from mitchellh/grapheme-break
Optimized grapheme break detection (6x speedup)
2024-02-10 07:54:06 -08:00
Mitchell Hashimoto
6f8b4204b9 terminal: use new grapheme break algo 2024-02-09 20:31:20 -08:00
Gregory Anders
21412847c7 Reset status display after a full reset 2024-02-09 15:50:50 -06:00
Mitchell Hashimoto
8d891fb05c terminal: fast-path ASCII on char width 2024-02-08 21:28:14 -08:00
Mitchell Hashimoto
c838bfc1c1 terminal: swap to table implementatino 2024-02-08 21:17:30 -08:00
Mitchell Hashimoto
17dc64053e terminal: swap codepointwidth implementations 2024-02-07 09:38:17 -08:00
Mitchell Hashimoto
eb653907d6 config: grapheme-width-method sets mode 2027
Fixes #1403

This changes the behavior of `grapheme-width-method = unicode` to change
the default state of mode 2027 to true. Prior to this, setting this
config would force grapheme clustering regardless of mode 2027. Now,
this only sets the default and running TUI programs can disable it if
they want.
2024-02-02 12:13:13 -08:00
Mitchell Hashimoto
4b607a07fe terminal: avoid reading reset memory for preserving prompt
Fixes #1400
2024-01-28 08:58:43 -08:00
Mitchell Hashimoto
2d612ab168 terminal: preserve multi-point grapheme clusters on scrollback deletion
This codepath was not previously tested (an accident). Upon testing
this codepath its clear to see the logic was incorrect. When we have to
remove rows from our scrollback to fit new rows in the circular buffer,
we have to delete graphemes, but we were deleting them from the wrong
row offset.

For the row offset, we previously used the _active_ screen but the
proper offset is the _full_ screen. Tests verify.
2024-01-25 09:35:56 -08:00
Mitchell Hashimoto
628b54fbb5 Merge pull request #1344 from rockorager/reflow
reflow: respect wraparound mode when reflowing text
2024-01-21 09:12:18 -08:00
Mitchell Hashimoto
8b23d5c9ab terminal: handle wide character print at edge with wraparound disabled
Fixes #1343

If a wide character is found at the right edge of a terminal screen and
can't be printed without wrapping, the wide character is ignored. This
matches xterm behavior.

The one funky behavior is with grapheme clustering enabled and VS16
emoji. For VS16, we act as if VS16 was never received. This is not
specified in any way and no other terminal handles this correctly at the
time of authoring this so we're just making this up because it seems
most sensible.
2024-01-21 09:02:15 -08:00
Tim Culverhouse
6dcec75e32 reflow: add unit tests for wraparound mode
Add unit tests for resizing with wraparound on and off.
2024-01-21 07:02:06 -06:00
Tim Culverhouse
28732b950c reflow: respect wraparound mode when reflowing text
When calling resize, Ghostty should be respecting the wraparound state.
This behavior matches xterm. Note that this same bug was also found in
kitty.

Fixes: #1343
2024-01-21 06:43:22 -06:00
Mitchell Hashimoto
3e3c07619e terminal: soft-wrap inherits semantic prompt status of previous line
Fixes #1334
2024-01-19 18:58:28 -08:00
Mitchell Hashimoto
e9fe14c750 terminal: ECH resets line wrap state in any scenario 2024-01-19 14:31:33 -08:00
Mitchell Hashimoto
bab932431f terminal: erase line right should reset soft wrap state 2024-01-19 14:08:09 -08:00
Mitchell Hashimoto
b87bbd55c5 termio: handle termio thread failure by showing a message in window
Fixes #1301
2024-01-15 20:22:55 -08:00