From 7eedc7714d9ad8e39b195baeb0864022b5ac2cce Mon Sep 17 00:00:00 2001 From: nick black Date: Thu, 17 Jun 2021 15:18:42 -0400 Subject: [PATCH] recognize Contour via XTVERSION, and turn on quadrants/rgb for it #1781 --- README.md | 2 +- TERMINALS.md | 2 +- src/lib/input.c | 2 ++ src/lib/termdesc.c | 4 ++++ src/lib/termdesc.h | 3 ++- 5 files changed, 10 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 002d19206..b53bdf59a 100644 --- a/README.md +++ b/README.md @@ -195,7 +195,7 @@ exporting the `COLORTERM` environment variable as `truecolor` or `24bit`. Note that some terminals accept a 24-bit specification, but map it down to fewer colors. -Since 2.3.1, 8bpc RGB is always enabled for Kitty, Alacritty, and foot. +TrueColor is always enabled for Kitty, Alacritty, Contour, and foot. ### Fonts diff --git a/TERMINALS.md b/TERMINALS.md index 33116c827..7f58b75b3 100644 --- a/TERMINALS.md +++ b/TERMINALS.md @@ -171,7 +171,7 @@ implementing `rgb` use the 3x8bpc model; XTerm for instance: Thus emitting `setaf` with an RGB value close to black can result, when using `xterm-direct`'s `setaf` and `rgb` definitions, in a bright ANSI color. -Since 2.3.1, DirectColor is always enabled for Kitty, Alacritty, and foot. +DirectColor is always enabled for Kitty, Alacritty, Contour, and foot. ## Problematic characters diff --git a/src/lib/input.c b/src/lib/input.c index 8b63940eb..41872c52a 100644 --- a/src/lib/input.c +++ b/src/lib/input.c @@ -726,6 +726,8 @@ stash_string(init_state* inits){ inits->qterm = TERMINAL_XTERM; }else if(strncmp(inits->runstring, "WezTerm ", strlen("WezTerm ")) == 0){ inits->qterm = TERMINAL_WEZTERM; + }else if(strncmp(inits->runstring, "contour ", strlen("contour ")) == 0){ + inits->qterm = TERMINAL_CONTOUR; } break; }case STATE_XTGETTCAP_TERMNAME1: diff --git a/src/lib/termdesc.c b/src/lib/termdesc.c index b65e7f69b..62dfcea84 100644 --- a/src/lib/termdesc.c +++ b/src/lib/termdesc.c @@ -134,6 +134,10 @@ apply_term_heuristics(tinfo* ti, const char* termname, int fd, } }else if(qterm == TERMINAL_XTERM){ termname = "XTerm"; + }else if(qterm == TERMINAL_CONTOUR){ + termname = "Contour"; + ti->quadrants = true; + ti->RGBflag = true; }else if(strcmp(termname, "linux") == 0){ termname = "Linux console"; ti->braille = false; // no braille, no sextants in linux console diff --git a/src/lib/termdesc.h b/src/lib/termdesc.h index 11eefc2d9..d3a4e92d3 100644 --- a/src/lib/termdesc.h +++ b/src/lib/termdesc.h @@ -175,8 +175,9 @@ typedef enum { TERMINAL_KITTY, // XTGETTCAP['TN'] == 'xterm-kitty' TERMINAL_FOOT, // TDA: "\EP!|464f4f54\E\\" TERMINAL_MLTERM, // XTGETTCAP['TN'] == 'mlterm' - TERMINAL_WEZTERM, + TERMINAL_WEZTERM, // XTVERSION == 'WezTerm *' TERMINAL_ALACRITTY, // can't be detected; match TERM + TERMINAL_CONTOUR, // XTVERSION == 'console *' } queried_terminals_e; #ifdef __cplusplus