aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2019-01-26 22:27:44 +0100
committerBoris Faure <billiob@gmail.com>2019-01-26 22:27:44 +0100
commit4eefb44ee1b0351ef41f7442c562f884f7b6cfa7 (patch)
tree7598d7844c3626eaff44483a7b9ddadb92fe61f9
parentwe're in 2019 (diff)
downloadterminology-4eefb44ee1b0351ef41f7442c562f884f7b6cfa7.tar.gz
termptyesc: handle DECSWBV + tests
-rw-r--r--src/bin/termptyesc.c30
-rwxr-xr-xtests/decswbv.sh22
-rw-r--r--tests/tests.results1
3 files changed, 53 insertions, 0 deletions
diff --git a/src/bin/termptyesc.c b/src/bin/termptyesc.c
index e65502f..b80c11c 100644
--- a/src/bin/termptyesc.c
+++ b/src/bin/termptyesc.c
@@ -2981,6 +2981,32 @@ _handle_esc_csi_vpa(Termpty *ty, Eina_Unicode **ptr)
ty->cursor_state.cy = arg - 1;
}
+static void
+_handle_esc_csi_decswbv(Termpty *ty, Eina_Unicode **ptr)
+{
+ Eina_Unicode *b = *ptr;
+ int arg = _csi_arg_get(ty, &b);
+
+ if (arg == -CSI_ARG_ERROR)
+ return;
+ DBG("DECSWBV - Set Warning Bell Volume: %d", arg);
+ switch (arg)
+ {
+ case 1:
+ DBG("Bell is off");
+ break;
+ case 2:
+ EINA_FALLTHROUGH;
+ case 3:
+ EINA_FALLTHROUGH;
+ case 4:
+ DBG("Bell volume is low");
+ break;
+ default:
+ DBG("Bell volume is high");
+ }
+}
+
static int
_handle_esc_csi(Termpty *ty, const Eina_Unicode *c, const Eina_Unicode *ce)
{
@@ -3182,6 +3208,10 @@ _handle_esc_csi(Termpty *ty, const Eina_Unicode *c, const Eina_Unicode *ce)
case 't':
if (*(cc-1) == '$')
_handle_esc_csi_decrara(ty, &b, be-1);
+ else if (*(cc-1) == ' ')
+ {
+ _handle_esc_csi_decswbv(ty, &b);
+ }
else
{
arg = _csi_arg_get(ty, &b);
diff --git a/tests/decswbv.sh b/tests/decswbv.sh
new file mode 100755
index 0000000..a5b46ec
--- /dev/null
+++ b/tests/decswbv.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+
+# fill space with E
+printf '\033#8'
+# set color
+printf '\033[46;31;3m'
+
+# Set Bell volume to Off
+printf '\033[1 t\007'
+# Set Bell volume to Low
+printf '\033[2 t\007'
+printf '\033[3 t\007'
+printf '\033[4 t\007'
+# Set Bell volume to High
+printf '\033[5 t\007'
+printf '\033[6 t\007'
+printf '\033[7 t\007'
+printf '\033[8 t\007'
+printf '\033[0 t\007'
+printf '\033[43 t\007'
+printf '\033[ t\007'
diff --git a/tests/tests.results b/tests/tests.results
index 0ea57ec..37e680e 100644
--- a/tests/tests.results
+++ b/tests/tests.results
@@ -75,3 +75,4 @@ rep.sh b91ebb46fb5ebd95aa2cb87ad12bb4ba
da.sh 3083fbec33befe5299ca3726a19fcff2
uts.sh 1c72fe49e7f98aac137d436ac4906bc8
vpa.sh c712e5c3c5e31a362e4257200d92d9a6
+decswbv.sh f7dde335d44f8691041d40c3efd24ffb