aboutsummaryrefslogtreecommitdiff
path: root/dcs.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2022-01-04 21:01:36 +0000
committerDaniel Eklöf <daniel@ekloef.se>2022-01-13 12:42:11 +0000
commit44aad0941fff3e314ae42c3c578cfa6d61913198 (patch)
treea9da3a943e3ef9e61ba99553b79dd4cd7f7448d6 /dcs.c
parentscripts: generate-builtin-terminfo: add custom capability ‘Co’ (diff)
dcs: xtgettcap: handle boolean capabilities
Reply with DCS 1 + r <cap> ST
Diffstat (limited to 'dcs.c')
-rw-r--r--dcs.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/dcs.c b/dcs.c
index 6fed8010..07fec5c7 100644
--- a/dcs.c
+++ b/dcs.c
@@ -99,6 +99,14 @@ xtgettcap_reply(struct terminal *term, const char *hex_cap_name, size_t len)
if (entry == NULL)
goto err;
+ if (entry->value == NULL) {
+ /* Boolean */
+ term_to_slave(term, "\033P1+r", 5);
+ term_to_slave(term, hex_cap_name, len);
+ term_to_slave(term, "\033\\", 2);
+ goto out;
+ }
+
/*
* Reply format:
* \EP 1 + r cap=value \E\\