aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2019-01-20 12:06:19 +0100
committerBoris Faure <billiob@gmail.com>2019-01-20 12:06:19 +0100
commit392c04bbe02aae2065fc756f66ea69eb31d39c19 (patch)
tree80643e1eff235d5296f59d45a94b1b30eea58887 /src
parenttermptyesc: export DA handler to its own function + tests (diff)
downloadterminology-392c04bbe02aae2065fc756f66ea69eb31d39c19.tar.gz
termptyesc: support Unset Tab Stop (only VTE so far) + tests
Diffstat (limited to 'src')
-rw-r--r--src/bin/termptyesc.c38
1 files changed, 28 insertions, 10 deletions
diff --git a/src/bin/termptyesc.c b/src/bin/termptyesc.c
index 6dd989a..a311760 100644
--- a/src/bin/termptyesc.c
+++ b/src/bin/termptyesc.c
@@ -2940,6 +2940,19 @@ _handle_esc_csi_da(Termpty *ty, Eina_Unicode **ptr)
termpty_write(ty, bf, len);
}
+static void
+_handle_esc_csi_uts(Termpty *ty, Eina_Unicode **ptr)
+{
+ Eina_Unicode *b = *ptr;
+ int arg = _csi_arg_get(ty, &b);
+
+ if (arg == -CSI_ARG_ERROR)
+ return;
+ DBG("UTS - Unset Tab Stop: %d", arg);
+ TERMPTY_RESTRICT_FIELD(arg, 0, ty->w);
+ TAB_UNSET(ty, arg);
+}
+
static int
_handle_esc_csi(Termpty *ty, const Eina_Unicode *c, const Eina_Unicode *ce)
{
@@ -3059,16 +3072,21 @@ _handle_esc_csi(Termpty *ty, const Eina_Unicode *c, const Eina_Unicode *ce)
case 'c':
_handle_esc_csi_da(ty, &b);
break;
- case 'd': // to row N
- arg = _csi_arg_get(ty, &b);
- if (arg == -CSI_ARG_ERROR)
- goto error;
- if (arg < 1)
- arg = 1;
- DBG("to row %d", arg);
- ty->termstate.wrapnext = 0;
- ty->cursor_state.cy = arg - 1;
- TERMPTY_RESTRICT_FIELD(ty->cursor_state.cy, 0, ty->h);
+ case 'd':
+ if (*(cc-1) == ' ')
+ _handle_esc_csi_uts(ty, &b);
+ else
+ {
+ arg = _csi_arg_get(ty, &b);
+ if (arg == -CSI_ARG_ERROR)
+ goto error;
+ if (arg < 1)
+ arg = 1;
+ DBG("to row %d", arg);
+ ty->termstate.wrapnext = 0;
+ ty->cursor_state.cy = arg - 1;
+ TERMPTY_RESTRICT_FIELD(ty->cursor_state.cy, 0, ty->h);
+ }
break;
case 'e':
_handle_esc_csi_cud(ty, &b);