diff options
author | Daniel Hahler <git@thequod.de> | 2019-08-02 19:39:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-02 19:39:29 +0200 |
commit | 24fb7eefaad1023938f43e8addb05d273b27323a (patch) | |
tree | 6ebc94196b22515ea4120b000012eb792fd30dbf | |
parent | a270c33b3a49d7a47b1bb6e6b9eb2073d98e0602 (diff) | |
download | rneovim-24fb7eefaad1023938f43e8addb05d273b27323a.tar.gz rneovim-24fb7eefaad1023938f43e8addb05d273b27323a.tar.bz2 rneovim-24fb7eefaad1023938f43e8addb05d273b27323a.zip |
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
-rw-r--r-- | src/nvim/tui/tui.c | 11 |
1 files 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, |