From f29190bdaabe5c6f4a5ce2dcef7b45e3f79101e7 Mon Sep 17 00:00:00 2001 From: Boris Faure Date: Mon, 6 Jul 2020 23:57:37 +0200 Subject: [PATCH] termptyesc: debug (re)setting cursor color + test Do nothing for the moment. One could think about using color class for that. --- src/bin/termptyesc.c | 6 ++++-- tests/tests.results | 1 + tests/xterm-set-cursor-color.sh | 22 ++++++++++++++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100755 tests/xterm-set-cursor-color.sh diff --git a/src/bin/termptyesc.c b/src/bin/termptyesc.c index 4965a3b2..70027b81 100644 --- a/src/bin/termptyesc.c +++ b/src/bin/termptyesc.c @@ -3622,7 +3622,7 @@ _osc_arg_get(Termpty *ty, Eina_Unicode **ptr) goto error; } } - if (*b != ';') + if (*b != ';' && *b != BEL) { sum = -ESC_ARG_ERROR; goto error; @@ -3636,7 +3636,6 @@ _osc_arg_get(Termpty *ty, Eina_Unicode **ptr) error: ERR("Invalid OSC argument"); ty->decoding_error = EINA_TRUE; - *ptr = NULL; return sum; } @@ -4322,6 +4321,9 @@ _handle_esc_osc(Termpty *ty, const Eina_Unicode *c, const Eina_Unicode *ce) goto err; _handle_xterm_11_command(ty, p, cc - c - (p - buf)); break; + case 12: + DBG("Set cursor color"); + break; case 50: DBG("xterm font support"); if (!p || !*p) diff --git a/tests/tests.results b/tests/tests.results index f50f65e4..b25ba817 100644 --- a/tests/tests.results +++ b/tests/tests.results @@ -148,3 +148,4 @@ xterm-osc-11.sh 3e02038964b78d948fb599c996bf370d xterm-colors-sharp.sh 79d6f72df04237d76a0fa3e722dcec5b xterm-colors-rgb.sh d9b55817ef8428343105b44dabd535a8 xterm-colors-rgbi.sh d9b55817ef8428343105b44dabd535a8 +xterm-set-cursor-color.sh e11819850eb17c3b09b94743e6b64ebd diff --git a/tests/xterm-set-cursor-color.sh b/tests/xterm-set-cursor-color.sh new file mode 100755 index 00000000..0d7004e1 --- /dev/null +++ b/tests/xterm-set-cursor-color.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +# char width: 7 +# char height: 15 + +# set color +printf '\033[0;31;3m' + +# clear screen +printf '\033[2J' + +# move to 0; 0 +printf '\033[0;0H' + +# set color +printf '\033[0m' + +# set cursor color +printf '\033]12;#ff00ff\007' +exit 0 +# reset cursor color +printf '\033]112\007'