-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
win,tty: Added set cursor style to CSI sequences #1884
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally seems reasonable, but I have a few comments.
Additionally, the repeated prev_utf8_codepoint != ' '
checks drive me crazy a little, it's kind difficult now to reason about state transitions now. Would it be possible to check for space at a single location, and maybe add an extra state flag (e.g. ANSI_DECSCUSR
) similar to the ANSI_EXTENSION
flag you just added?
a7c279a
to
fff3c4b
Compare
@erw7 any way to unit test this? |
fff3c4b
to
f1715a1
Compare
I think that it is possible. But in order to do unit tests, I think that it is necessary to change |
I wrote the test and noticed the following things, please tell me about I think it is a bug to initialize If the above is correct, I think that |
726f05f
to
58f4f81
Compare
Nice work @erw7. |
Note that on windows 10 these tests don't all pass, because windows processes the escape sequences and not libuv. Maybe you can somehow forcefully enable libuv's escape sequence processing when running the tty tests? test output1..340 ok 1 - tty ok 2 - tty_cursor_back ok 3 - tty_cursor_down ok 4 - tty_cursor_forward ok 5 - tty_cursor_horizontal_move_absolute ok 6 - tty_cursor_move_absolute ok 7 - tty_cursor_next_line ok 8 - tty_cursor_previous_line ok 9 - tty_cursor_up ok 10 - tty_empty_write ok 11 - tty_erase ok 12 - tty_erase_line not ok 13 - tty_escape_sequence_processing # exit code 3 # Output from process `tty_escape_sequence_processing`: # line:1 col:1 expected character 'H' but found ' ' # line:1 col:2 expected character 'e' but found ' ' # line:1 col:3 expected character 'l' but found ' ' # line:1 col:4 expected character 'l' but found ' ' # line:1 col:5 expected character 'o' but found ' ' # line:1 col:6 expected character 'H' but found ' ' # line:1 col:7 expected character 'e' but found ' ' # line:1 col:8 expected character 'l' but found ' ' # line:1 col:9 expected character 'l' but found ' ' # line:1 col:10 expected character 'o' but found ' ' # Assertion failed in c:\users\bertbelder\d\libuv\test\test-tty-escape-sequence-processing.c on line 1362: compare_screen(&tty_out, &actual, &expect) ok 14 - tty_file ok 15 - tty_full_reset ok 16 - tty_hide_show_cursor ok 17 - tty_large_write ok 18 - tty_pty ok 19 - tty_raw ok 20 - tty_save_restore_cursor_position ok 21 - tty_set_cursor_shape not ok 22 - tty_set_style # exit code 3 # Output from process `tty_set_style`: # line:23 col:77 expected character 'H' but found ' ' # line:23 col:77 expected attributes '0' but found '7' # line:23 col:78 expected character 'e' but found ' ' # line:23 col:78 expected attributes '0' but found '7' # line:23 col:79 expected character 'l' but found ' ' # line:23 col:79 expected attributes '0' but found '7' # line:23 col:80 expected character 'l' but found ' ' # line:23 col:80 expected attributes '0' but found '7' # line:23 col:81 expected character 'o' but found ' ' # line:23 col:81 expected attributes '0' but found '7' # Assertion failed in c:\users\bertbelder\d\libuv\test\test-tty-escape-sequence-processing.c on line 1093: compare_screen(&tty_out, &actual, &expect) |
Work toward landing libuv#1884
I think that tty tests use libuv escape sequence processing, because I call When I compiled with MSYS 2 MinGW 64-bit on WIndows 10 installed in Virtual Box, I passed the corresponding test. |
2912ee5
to
ea995b2
Compare
- Retrieve libuv#1884 changes - Change uv_set_vterm_state from Private to Public - Revert "win,tty: Use ANSI and Xterm processing of ConEmu (#1)"
Retrieve libuv#1884 changes
- Retrieve libuv#1884 changes - Change uv_set_vterm_state from Private to Public - Revert "win,tty: Use ANSI and Xterm processing of ConEmu (#1)"
- Retrieve libuv#1884 changes - Change uv_set_vterm_state from Private to Public - Revert "win,tty: Use ANSI and Xterm processing of ConEmu (#1)"
- Retrieve libuv#1884 changes - Change uv_set_vterm_state from Private to Public - Revert "win,tty: Use ANSI and Xterm processing of ConEmu (#1)"
- Retrieve libuv#1884 changes - Change uv_set_vterm_state from Private to Public - Revert "win,tty: Use ANSI and Xterm processing of ConEmu (#1)"
- Retrieve libuv#1884 changes - Change uv_set_vterm_state from Private to Public - Revert "win,tty: Use ANSI and Xterm processing of ConEmu (#1)"
@erw7 feel free to land! |
PR-URL: libuv#1884 Co-authored-by: Jameson Nash <vtjnash@gmail.com> Co-authored-by: Bert Belder <bertbelder@gmail.com> Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com> Reviewed-By: Jameson Nash <vtjnash@gmail.com>
PR-URL: libuv#1884 Co-authored-by: Jameson Nash <vtjnash@gmail.com> Co-authored-by: Bert Belder <bertbelder@gmail.com> Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com> Reviewed-By: Jameson Nash <vtjnash@gmail.com>
dd3ed1f
to
7961d23
Compare
PR-URL: libuv#1884 Co-authored-by: Bert Belder <bertbelder@gmail.com> Co-authored-by: Jameson Nash <vtjnash@gmail.com> Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com> Reviewed-By: Jameson Nash <vtjnash@gmail.com>
PR-URL: libuv#1884 Co-authored-by: Bert Belder <bertbelder@gmail.com> Co-authored-by: Jameson Nash <vtjnash@gmail.com> Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com> Reviewed-By: Jameson Nash <vtjnash@gmail.com>
7961d23
to
969ae54
Compare
PR-URL: libuv#1884 Co-authored-by: Bert Belder <bertbelder@gmail.com> Co-authored-by: Jameson Nash <vtjnash@gmail.com> Reviewed-By: Saúl Ibarra Corretgé <s@saghul.net> Reviewed-By: Jameson Nash <vtjnash@gmail.com>
PR-URL: libuv#1884 Refs: libuv#1874 Co-authored-by: Bert Belder <bertbelder@gmail.com> Co-authored-by: Jameson Nash <vtjnash@gmail.com> Reviewed-By: Saúl Ibarra Corretgé <s@saghul.net> Reviewed-By: Jameson Nash <vtjnash@gmail.com>
969ae54
to
6f8dae3
Compare
PR-URL: #1884 Co-authored-by: Bert Belder <bertbelder@gmail.com> Co-authored-by: Jameson Nash <vtjnash@gmail.com> Reviewed-By: Jameson Nash <vtjnash@gmail.com> Reviewed-By: Saúl Ibarra Corretgé <s@saghul.net>
Awesome, thanks @erw7 this is epic! Now this is in, revisiting scroll region handling seems more approachable. |
PR-URL: libuv#1884 Co-authored-by: Bert Belder <bertbelder@gmail.com> Co-authored-by: Jameson Nash <vtjnash@gmail.com> Reviewed-By: Jameson Nash <vtjnash@gmail.com> Reviewed-By: Saúl Ibarra Corretgé <s@saghul.net> (cherry picked from commit 73ca4ac)
PR-URL: libuv#1884 Refs: libuv#1874 Co-authored-by: Bert Belder <bertbelder@gmail.com> Co-authored-by: Jameson Nash <vtjnash@gmail.com> Reviewed-By: Jameson Nash <vtjnash@gmail.com> Reviewed-By: Saúl Ibarra Corretgé <s@saghul.net> (cherry picked from commit 288a067)
PR-URL: libuv#1884 Co-authored-by: Bert Belder <bertbelder@gmail.com> Co-authored-by: Jameson Nash <vtjnash@gmail.com> Reviewed-By: Jameson Nash <vtjnash@gmail.com> Reviewed-By: Saúl Ibarra Corretgé <s@saghul.net> (cherry picked from commit 73ca4ac)
PR-URL: libuv#1884 Refs: libuv#1874 Co-authored-by: Bert Belder <bertbelder@gmail.com> Co-authored-by: Jameson Nash <vtjnash@gmail.com> Reviewed-By: Jameson Nash <vtjnash@gmail.com> Reviewed-By: Saúl Ibarra Corretgé <s@saghul.net> (cherry picked from commit 288a067)
PR-URL: libuv#1884 Co-authored-by: Bert Belder <bertbelder@gmail.com> Co-authored-by: Jameson Nash <vtjnash@gmail.com> Reviewed-By: Jameson Nash <vtjnash@gmail.com> Reviewed-By: Saúl Ibarra Corretgé <s@saghul.net> (cherry picked from commit 73ca4ac)
PR-URL: libuv#1884 Refs: libuv#1874 Co-authored-by: Bert Belder <bertbelder@gmail.com> Co-authored-by: Jameson Nash <vtjnash@gmail.com> Reviewed-By: Jameson Nash <vtjnash@gmail.com> Reviewed-By: Saúl Ibarra Corretgé <s@saghul.net> (cherry picked from commit 288a067)
PR-URL: libuv#1884 Co-authored-by: Bert Belder <bertbelder@gmail.com> Co-authored-by: Jameson Nash <vtjnash@gmail.com> Reviewed-By: Jameson Nash <vtjnash@gmail.com> Reviewed-By: Saúl Ibarra Corretgé <s@saghul.net> (cherry picked from commit 73ca4ac)
PR-URL: libuv#1884 Refs: libuv#1874 Co-authored-by: Bert Belder <bertbelder@gmail.com> Co-authored-by: Jameson Nash <vtjnash@gmail.com> Reviewed-By: Jameson Nash <vtjnash@gmail.com> Reviewed-By: Saúl Ibarra Corretgé <s@saghul.net> (cherry picked from commit 288a067)
PR-URL: libuv#1884 Co-authored-by: Bert Belder <bertbelder@gmail.com> Co-authored-by: Jameson Nash <vtjnash@gmail.com> Reviewed-By: Jameson Nash <vtjnash@gmail.com> Reviewed-By: Saúl Ibarra Corretgé <s@saghul.net> (cherry picked from commit 73ca4ac)
PR-URL: libuv#1884 Refs: libuv#1874 Co-authored-by: Bert Belder <bertbelder@gmail.com> Co-authored-by: Jameson Nash <vtjnash@gmail.com> Reviewed-By: Jameson Nash <vtjnash@gmail.com> Reviewed-By: Saúl Ibarra Corretgé <s@saghul.net> (cherry picked from commit 288a067)
PR-URL: libuv#1884 Co-authored-by: Bert Belder <bertbelder@gmail.com> Co-authored-by: Jameson Nash <vtjnash@gmail.com> Reviewed-By: Jameson Nash <vtjnash@gmail.com> Reviewed-By: Saúl Ibarra Corretgé <s@saghul.net> (cherry picked from commit 73ca4ac)
PR-URL: libuv#1884 Refs: libuv#1874 Co-authored-by: Bert Belder <bertbelder@gmail.com> Co-authored-by: Jameson Nash <vtjnash@gmail.com> Reviewed-By: Jameson Nash <vtjnash@gmail.com> Reviewed-By: Saúl Ibarra Corretgé <s@saghul.net> (cherry picked from commit 288a067)
This is for adding a set cursor style(CSI Ps SP q, CSI SP q) to handling of libuv escape sequence. This was originally created for neovim(neovim/neovim#8462).
Fix except
3.
of #1874. I confirmed3.
with another terminal(xterm, mintty). Since another terminal accepted a sequence likeCSI Ps ; Ps ; Ps H
, I did not fix it.