aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2018-12-29 17:18:39 +0100
committerBoris Faure <billiob@gmail.com>2018-12-29 17:21:07 +0100
commit68787ad524a359634880b7f2e7fe820b881c40af (patch)
tree7e8ef2bd03e77014158a9894040dd2804864ac12 /src
parenttermptyesc: handle deccara in its rectangular form + tests (diff)
downloadterminology-68787ad524a359634880b7f2e7fe820b881c40af.tar.gz
tests/termptyesc: handle DECSACE
Also regenerate tests since checksums changed due to new attribute
Diffstat (limited to 'src')
-rw-r--r--src/bin/termpty.h1
-rw-r--r--src/bin/termptyesc.c30
-rw-r--r--src/bin/termptyops.c1
3 files changed, 32 insertions, 0 deletions
diff --git a/src/bin/termpty.h b/src/bin/termpty.h
index dd08f08..7a3aee2 100644
--- a/src/bin/termpty.h
+++ b/src/bin/termpty.h
@@ -120,6 +120,7 @@ typedef struct _Term_State {
unsigned int cjk_ambiguous_wide : 1;
unsigned int hide_cursor : 1;
unsigned int combining_strike : 1;
+ unsigned int sace_rectangular : 1;
} Term_State;
typedef struct _Term_Cursor {
diff --git a/src/bin/termptyesc.c b/src/bin/termptyesc.c
index bfde79c..e6c6410 100644
--- a/src/bin/termptyesc.c
+++ b/src/bin/termptyesc.c
@@ -1772,6 +1772,34 @@ _handle_esc_csi_decscusr(Termpty *ty, Eina_Unicode **b)
termio_set_cursor_shape(ty->obj, shape);
}
+static void
+_handle_esc_csi_decsace(Termpty *ty, Eina_Unicode **b)
+{
+ int arg = _csi_arg_get(ty, b);
+
+ DBG("DECSACE (%d) Select Attribute Change Extent", arg);
+
+ switch (arg)
+ {
+ case -CSI_ARG_ERROR:
+ return;
+ case -CSI_ARG_NO_VALUE:
+ EINA_FALLTHROUGH;
+ case 0:
+ EINA_FALLTHROUGH;
+ case 1:
+ ty->termstate.sace_rectangular = 0;
+ break;
+ case 2:
+ ty->termstate.sace_rectangular = 1;
+ break;
+ default:
+ WRN("Invalid DECSACE %d", arg);
+ ty->decoding_error = EINA_TRUE;
+ return;
+ }
+}
+
static int
_handle_esc_csi(Termpty *ty, const Eina_Unicode *c, const Eina_Unicode *ce)
{
@@ -2251,6 +2279,8 @@ HVP:
case 'x':
if (*(cc-1) == '$')
_handle_esc_csi_decfra(ty, &b);
+ else if (*(cc-1) == '*')
+ _handle_esc_csi_decsace(ty, &b);
break;
case 'z':
if (*(cc-1) == '$')
diff --git a/src/bin/termptyops.c b/src/bin/termptyops.c
index ad6bf62..2684e88 100644
--- a/src/bin/termptyops.c
+++ b/src/bin/termptyops.c
@@ -459,6 +459,7 @@ termpty_soft_reset_state(Termpty *ty)
ty->termstate.no_autorepeat = 0;
ty->termstate.cjk_ambiguous_wide = 0;
ty->termstate.hide_cursor = 0;
+ ty->termstate.sace_rectangular = 0;
ty->mouse_mode = MOUSE_OFF;
ty->mouse_ext = MOUSE_EXT_NONE;
ty->bracketed_paste = 0;