From 90e962fff8f4d251cdf7fcc653caa34973c82d91 Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 28 Jan 2020 10:59:29 +0000 Subject: Add support for the iTerm2 DSR 1337 sequence to get the terminal version. --- tty-keys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tty-keys.c') diff --git a/tty-keys.c b/tty-keys.c index 968f67ca..987fd1b0 100644 --- a/tty-keys.c +++ b/tty-keys.c @@ -1099,7 +1099,7 @@ tty_keys_device_status_report(struct tty *tty, const char *buf, size_t len, return (-1); if (len == 2) return (1); - if (buf[2] != 'I') + if (buf[2] != 'I' && buf[2] != 'T') return (-1); if (len == 3) return (1); -- cgit From a6129e99749d2bbc8b4a991c7b5d09300aa55f39 Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 28 Jan 2020 11:39:51 +0000 Subject: If we can identify the terminal as iTerm2 or as tmux, we can be sure they support 256 and RGB colours, so set those flags too. --- tty-keys.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tty-keys.c') diff --git a/tty-keys.c b/tty-keys.c index 987fd1b0..064f2172 100644 --- a/tty-keys.c +++ b/tty-keys.c @@ -1117,7 +1117,9 @@ tty_keys_device_status_report(struct tty *tty, const char *buf, size_t len, /* Set terminal flags. */ if (strncmp(tmp, "ITERM2 ", 7) == 0) - flags |= TERM_DECSLRM; + flags |= (TERM_DECSLRM|TERM_256COLOURS|TERM_RGBCOLOURS); + if (strncmp(tmp, "TMUX ", 5) == 0) + flags |= (TERM_256COLOURS|TERM_RGBCOLOURS); log_debug("%s: received DSR %.*s", c->name, (int)*size, buf); tty_set_flags(tty, flags); -- cgit