294 Commits

Author SHA1 Message Date
Mitchell Hashimoto
d3483a8eed terminal: extended reverse wrap takes priority over reverse wrap 2023-10-06 08:59:22 -07:00
Mitchell Hashimoto
a1becf73ad terminal: CUB extended reverse wrap mode 2023-10-06 08:55:09 -07:00
Mitchell Hashimoto
9e506ac7e1 terminal: cursor back handles reverse wrap (mode 45) 2023-10-06 08:35:02 -07:00
Mitchell Hashimoto
7fe1a61ae8 terminal: cursor back should reduce count if pending wrap is one 2023-10-06 07:52:15 -07:00
Mitchell Hashimoto
5f96adb993 terminal: mode 2027 2023-10-02 09:34:43 -07:00
Mitchell Hashimoto
3f48a43ba4 terminal: cursors must set pending wrap 2023-09-25 17:42:37 -07:00
Mitchell Hashimoto
2c26071332 terminal: eraseLine resets wrap 2023-09-25 17:32:51 -07:00
Mitchell Hashimoto
1f3138add7 terminal: eraseChars resets wrap 2023-09-25 16:23:29 -07:00
Mitchell Hashimoto
804d252787 terminal: deleteChars resets pending wrap state 2023-09-25 16:21:04 -07:00
Mitchell Hashimoto
27cc8e5529 terminal: insertLines resets wrap 2023-09-25 16:17:22 -07:00
Mitchell Hashimoto
961e836d67 terminal: DL should reset wrap 2023-09-25 16:13:07 -07:00
Tim Culverhouse
5d598e4e33 terminal: only use bg attr when erasing line
Similar to eraseDisplay semantics, erase line should only apply the bg
attr to erased cells.
2023-09-25 16:07:48 -05:00
Mitchell Hashimoto
35f89bd28c terminal: eraseDisplay protected 2023-09-25 11:16:06 -07:00
Mitchell Hashimoto
f1c771615f terminal: eraseLine protected, tests 2023-09-25 10:56:59 -07:00
Mitchell Hashimoto
2a390785f5 terminal: add protected mode flag to cursor pen 2023-09-25 10:56:57 -07:00
Tim Culverhouse
3264e70701 terminal: don't modify pen state when erasing eraseDisplay
Erasing the display should be done with only the background attribute of
the current pen. This is the current behavior but is done by altering
the current pen state. The pen state should remain after erasure. Use a
new pen variable to erase the display to enable retaining the pen state.
Add a test condition.
2023-09-25 12:25:45 -05:00
Tim Culverhouse
b592b069c8 terminal: retain cursor and charset when entering alt screen
The state of the cursor and charset should be retained when entering the
alternate screen.

Fixes: alacritty/save_cursor_alt
2023-09-25 11:42:01 -05:00
Tim Culverhouse
66875206bb terminal: move charset to screen
Each screen (primary and alternate) retains the state of the current
charset when DECSC (save cursor) is called. Move the CharsetState into
the screen to enable saving the state with each screen.

Add a test for charset state on screen change
2023-09-25 10:43:39 -05:00
Tim Culverhouse
3d35ae1869 terminal: save charset state and DECOM mode when saving cursor
The charset state and DECOM mode should be saved along with the cursor
state.

Reference: https://vt100.net/docs/vt510-rm/DECSC.html
Fixes: alacritty/saved_cursor
2023-09-24 21:56:48 -05:00
Tim Culverhouse
17ee5c7fd5 terminal: insert a blank cell in insertBlanks
The name sounds obvious, but nothing ever is with ANSI escapes. ICH
(Insert Blank Characters) should insert a cell with no attributes or
colors set.

Remove comment about inserting a space for tests: the tests pass with a
blank cell inserted.

Remove comment about inserted cells having current SGR.

Update tests to check for attribute of inserted cell.
2023-09-24 21:56:48 -05:00
Tim Culverhouse
5f87e09d61 terminal: make deleteChars insert blank cells
When DCH (deleteChars) deletes cells from a line, cells are inserted
from the right. The new cells should not have the current pen style, and
should instead be an empty cell.

Add check for this in the existing test.

Fixes: alacritty/deccolm_reset
2023-09-24 19:12:38 -05:00
Mitchell Hashimoto
056de47b76 terminal: make switch true/false more idiomatic zig 2023-09-22 23:12:46 -07:00
Tim Culverhouse
2051e6bb3a terminal: ensure 'has_bg' is set in eraseDisplay
Add a check for 'has_bg', and if it is set retain the background color.
If it isn't set, we are safe to set the pen to it's default.

Fixes: alacritty/colored_reset
2023-09-23 00:37:59 -05:00
Tim Culverhouse
c5df73b1da terminal: erase pen, except bg, in eraseDisplay
When erasing the display, all attributes of the pen must be cleared
_except_ for the background. Add unit tests for erasing the display in
all scenarios.

Fixes: alacritty/clear_underline
2023-09-22 21:14:36 -05:00
Tim Culverhouse
2784f25b5b terminal: reset cursor state before eraseDisplay in fullReset
fullReset resets the state of the terminal. This method calls
eraseDisplay, which depends on the state of the cursor pen for setting
the cell styles when it erases. Reset the state of the cursor prior to
calling eraseDisplay to ensure a clean reset.

Fixes: alacritty/alt_reset test
2023-09-22 20:11:04 -05:00
Mitchell Hashimoto
eeba3057f9 terminal: CSI G must reset pending wrap state
Fixes #479
2023-09-18 22:14:04 -07:00
Mitchell Hashimoto
ab4acf0d00 core: send mouse motion events if motion tracking and button pressed 2023-09-17 11:45:53 -07:00
Mitchell Hashimoto
cdf81b610d terminal: mark prompt continuation lines, end prompt clear at first
prompt
2023-09-03 14:00:56 -07:00
Mitchell Hashimoto
aa04c79586 terminal: CSI P must shift all remaining columns to right of cursor
Fixes #388
2023-09-02 11:28:37 -07:00
Mitchell Hashimoto
a6007cab7a terminal: fix unimplemented origin mode check 2023-09-01 08:46:53 -07:00
Mitchell Hashimoto
f4fef559fb terminal: delete lines outside of scroll region should do nothing 2023-08-31 20:41:32 -07:00
Mitchell Hashimoto
6c13627d51 terminal: delete chars (CSI P) tested, fixes many issues 2023-08-31 19:42:23 -07:00
Mitchell Hashimoto
d05381db83 remove some unreachables, log errors to avoid crashes
These are still TODO but we don't want to crash on bad input.
2023-08-31 14:55:27 -07:00
Mitchell Hashimoto
7e846bd367 terminal: tabstops were off by one
Fixes #359

See #359 for a test script. The unit tests were also wrong. I used the
test script in #359 to verify the exact column that tabstops should be
set at.
2023-08-29 20:18:54 -07:00
Mitchell Hashimoto
86495e826c Merge pull request #317 from mitchellh/kitty-gfx
Kitty Graphics Protocol Initial Support
2023-08-24 08:50:13 -07:00
Mitchell Hashimoto
9ab25ef350 terminal/kitty-gfx: delete intersecting cursor 2023-08-23 10:53:38 -07:00
Mitchell Hashimoto
a082e4c1a2 terminal: delete lines (CSI M) should clamp count to remaining lines 2023-08-22 16:43:21 -07:00
Mitchell Hashimoto
71f1f35cfc terminal/kitty-gfx: move cursor after image placement 2023-08-22 12:15:51 -07:00
Mitchell Hashimoto
660faf3ac3 terminal: clear screen, alt screen, etc. clear all kitty graphics 2023-08-21 15:34:46 -07:00
Mitchell Hashimoto
b2432a672f terminal/kitty-gfx: add debug function to dump image data 2023-08-21 08:28:20 -07:00
Mitchell Hashimoto
c7658df978 terminal/kitty-gfx: support "query", loading images, tests 2023-08-20 22:03:20 -07:00
Mitchell Hashimoto
8435d45bc9 terminal: proper reverseIndex behavior with scroll region set
Fixes #298

This fix is quite simple and the code should be more or less obvious:
we weren't handling scroll regions properly for the reverse index (RI)
escape sequence.
2023-08-18 08:32:13 -07:00
Mitchell Hashimoto
8ca8da38d8 Merge pull request #291 from mitchellh/grapheme-sel
Fix multiple bugs related to selecting, copying grapheme clusters
2023-08-15 15:57:26 -07:00
Mitchell Hashimoto
6a4b25714a terminal: add a test to verify our grapheme state is what we expect 2023-08-15 13:55:35 -07:00
Mitchell Hashimoto
951aa00c63 terminal: move to new modes struct 2023-08-15 11:30:33 -07:00
Mitchell Hashimoto
4a384aa272 parse and respect mode 1036 2023-08-13 15:12:13 -07:00
Mitchell Hashimoto
66aa1d9be3 terminal: parse and handle set modify key format (ESC[>{a};{b}m) 2023-08-13 14:55:32 -07:00
Mitchell Hashimoto
d94474463b terminal: handle set application keypad mode (both ESC and modes) 2023-08-13 14:55:32 -07:00
Mitchell Hashimoto
9b5fd4b2ee terminal: print wide char with 1-col width 2023-08-12 10:27:42 -07:00
Mitchell Hashimoto
a8380e937d scroll top, bot, page up, page down binding actions 2023-08-09 07:24:11 -07:00