Skip to content

Commit f29190b

Browse files
committed
termptyesc: debug (re)setting cursor color + test
Do nothing for the moment. One could think about using color class for that.
1 parent a99ddc1 commit f29190b

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

src/bin/termptyesc.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3622,7 +3622,7 @@ _osc_arg_get(Termpty *ty, Eina_Unicode **ptr)
36223622
goto error;
36233623
}
36243624
}
3625-
if (*b != ';')
3625+
if (*b != ';' && *b != BEL)
36263626
{
36273627
sum = -ESC_ARG_ERROR;
36283628
goto error;
@@ -3636,7 +3636,6 @@ _osc_arg_get(Termpty *ty, Eina_Unicode **ptr)
36363636
error:
36373637
ERR("Invalid OSC argument");
36383638
ty->decoding_error = EINA_TRUE;
3639-
*ptr = NULL;
36403639
return sum;
36413640
}
36423641

@@ -4322,6 +4321,9 @@ _handle_esc_osc(Termpty *ty, const Eina_Unicode *c, const Eina_Unicode *ce)
43224321
goto err;
43234322
_handle_xterm_11_command(ty, p, cc - c - (p - buf));
43244323
break;
4324+
case 12:
4325+
DBG("Set cursor color");
4326+
break;
43254327
case 50:
43264328
DBG("xterm font support");
43274329
if (!p || !*p)

tests/tests.results

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,3 +148,4 @@ xterm-osc-11.sh 3e02038964b78d948fb599c996bf370d
148148
xterm-colors-sharp.sh 79d6f72df04237d76a0fa3e722dcec5b
149149
xterm-colors-rgb.sh d9b55817ef8428343105b44dabd535a8
150150
xterm-colors-rgbi.sh d9b55817ef8428343105b44dabd535a8
151+
xterm-set-cursor-color.sh e11819850eb17c3b09b94743e6b64ebd

tests/xterm-set-cursor-color.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/sh
2+
3+
# char width: 7
4+
# char height: 15
5+
6+
# set color
7+
printf '\033[0;31;3m'
8+
9+
# clear screen
10+
printf '\033[2J'
11+
12+
# move to 0; 0
13+
printf '\033[0;0H'
14+
15+
# set color
16+
printf '\033[0m'
17+
18+
# set cursor color
19+
printf '\033]12;#ff00ff\007'
20+
exit 0
21+
# reset cursor color
22+
printf '\033]112\007'

0 commit comments

Comments
 (0)