Add an I format modifier to get some bits of information about a client

(terminal features, capabilities and environment).
This commit is contained in:
nicm
2026-06-13 09:17:29 +00:00
parent 34a6a9d3a1
commit b44cdf1006
5 changed files with 119 additions and 2 deletions

View File

@@ -765,6 +765,18 @@ tty_term_has(struct tty_term *term, enum tty_code_code code)
return (term->codes[code].type != TTYCODE_NONE);
}
int
tty_term_has_name(struct tty_term *term, const char *name)
{
u_int i;
for (i = 0; i < tty_term_ncodes(); i++) {
if (strcmp(tty_term_codes[i].name, name) == 0)
return (tty_term_has(term, i));
}
return (0);
}
const char *
tty_term_string(struct tty_term *term, enum tty_code_code code)
{