From 24fb7eefaad1023938f43e8addb05d273b27323a Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Fri, 2 Aug 2019 19:39:29 +0200 Subject: [PATCH] terminfo_start: use unibi_from_term, skip without TERM (#10670) This is clearer/more explicit and avoids potential mismatch between what unibilium thinks vs what Nvim thinks. For reference: https://github.com/mauke/unibilium/blob/e3b16d6219ca1cb92d98b1d9cc416b49a3ac468e/uniutil.c#L203-L211 --- src/nvim/tui/tui.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 58ef540707..519ef1cccd 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -227,12 +227,15 @@ static void terminfo_start(UI *ui) #endif // Set up unibilium/terminfo. - data->ut = unibi_from_env(); char *termname = NULL; - if (!term || !data->ut) { + if (term) { + data->ut = unibi_from_term(term); + if (data->ut) { + termname = xstrdup(term); + } + } + if (!data->ut) { data->ut = terminfo_from_builtin(term, &termname); - } else { - termname = xstrdup(term); } // Update 'term' option. loop_schedule_deferred(&main_loop,