From 0a959617c648eb0fc8035095973054b708a03940 Mon Sep 17 00:00:00 2001 From: nick black Date: Sat, 28 Aug 2021 19:22:15 -0400 Subject: [PATCH] detect MinTTY with XTVERSION #2115 --- src/lib/input.c | 1 + src/lib/input.h | 1 + src/lib/termdesc.c | 2 ++ 3 files changed, 4 insertions(+) diff --git a/src/lib/input.c b/src/lib/input.c index 128738ee7..4df7fb7c3 100644 --- a/src/lib/input.c +++ b/src/lib/input.c @@ -1081,6 +1081,7 @@ stash_string(query_state* inits){ { .prefix = "mlterm(", .suffix = ')', .term = TERMINAL_MLTERM, }, { .prefix = "tmux ", .suffix = 0, .term = TERMINAL_TMUX, }, { .prefix = "iTerm2 ", .suffix = 0, .term = TERMINAL_ITERM, }, + { .prefix = "mintty ", .suffix = 0, .term = TERMINAL_MINTTY, }, { .prefix = NULL, .suffix = 0, .term = TERMINAL_UNKNOWN, }, }, *xtv; for(xtv = xtvers ; xtv->prefix ; ++xtv){ diff --git a/src/lib/input.h b/src/lib/input.h index 15b95b9c1..d68dd8dfb 100644 --- a/src/lib/input.h +++ b/src/lib/input.h @@ -34,6 +34,7 @@ typedef enum { TERMINAL_TERMINOLOGY, // TDA: "~~TY" TERMINAL_APPLE, // Terminal.App, determined by TERM_PROGRAM + macOS TERMINAL_MSTERMINAL, // Microsoft Windows Terminal + TERMINAL_MINTTY, // XTVERSION == 'mintty ver' MinTTY (Cygwin, MSYS2) } queried_terminals_e; // sets up the input layer, building a trie of escape sequences and their diff --git a/src/lib/termdesc.c b/src/lib/termdesc.c index b71d13fb6..92356d88a 100644 --- a/src/lib/termdesc.c +++ b/src/lib/termdesc.c @@ -555,6 +555,8 @@ apply_term_heuristics(tinfo* ti, const char* termname, queried_terminals_e qterm return -1; } } + }else if(qterm == TERMINAL_MINTTY){ + termname = "MinTTY"; }else if(qterm == TERMINAL_CONTOUR){ termname = "Contour"; ti->caps.quadrants = true;