dcs: xtgettcap: handle boolean capabilities

Reply with DCS 1 + r <cap> ST
This commit is contained in:
Daniel Eklöf 2022-01-04 22:01:36 +01:00
parent 7feab6092c
commit 44aad0941f
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 13 additions and 4 deletions

8
dcs.c
View file

@ -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\\