aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/termptyesc.c
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2018-03-15 19:20:09 +0100
committerBoris Faure <billiob@gmail.com>2018-03-15 19:20:09 +0100
commit740e96da668aab9c9b2651c5e4fa553038a20887 (patch)
treeec4c12c0da0410fe77a4790e94b579ce3f5ed6cf /src/bin/termptyesc.c
parenttermptyesc: sort CSI escape code by ascii value (diff)
downloadterminology-740e96da668aab9c9b2651c5e4fa553038a20887.tar.gz
handle DECSCUSR (changing cursor shape). Closes https://phab.enlightenment.org/T6338
Diffstat (limited to 'src/bin/termptyesc.c')
-rw-r--r--src/bin/termptyesc.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/bin/termptyesc.c b/src/bin/termptyesc.c
index 436c7d5..85bf1bd 100644
--- a/src/bin/termptyesc.c
+++ b/src/bin/termptyesc.c
@@ -1193,6 +1193,41 @@ _handle_esc_csi_cursor_pos_set(Termpty *ty, Eina_Unicode **b,
ty->cursor_state.cy = cy;
}
+static void
+_handle_esc_csi_decscusr(Termpty *ty, Eina_Unicode **b)
+{
+ int arg = _csi_arg_get(b);
+ Cursor_Shape shape = CURSOR_SHAPE_BLOCK;
+
+ DBG("DECSCUSR (%d) Set Cursor Shape", arg);
+
+ switch (arg)
+ {
+ case 0:
+ EINA_FALLTHROUGH;
+ case 1:
+ EINA_FALLTHROUGH;
+ case 2:
+ shape = CURSOR_SHAPE_BLOCK;
+ break;
+ case 3:
+ EINA_FALLTHROUGH;
+ case 4:
+ shape = CURSOR_SHAPE_UNDERLINE;
+ break;
+ case 5:
+ EINA_FALLTHROUGH;
+ case 6:
+ shape = CURSOR_SHAPE_BAR;
+ break;
+ default:
+ WRN("Invalid DECSCUSR %d", shape);
+ return;
+ }
+
+ termio_set_cursor_shape(ty->obj, shape);
+}
+
static int
_handle_esc_csi(Termpty *ty, const Eina_Unicode *c, const Eina_Unicode *ce)
{
@@ -1575,6 +1610,18 @@ HVP:
goto unhandled;
}
break;
+ case 'q':
+ if (*(cc-1) == ' ')
+ _handle_esc_csi_decscusr(ty, &b);
+ else if (*(cc-1) == '"')
+ {
+ WRN("TODO: select character protection attribute (DECSCA)");
+ }
+ else
+ {
+ WRN("TODO: Load LEDs (DECLL)");
+ }
+ break;
case 'r':
_handle_esc_csi_decstbm(ty, &b);
break;