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: e3b16d6219/uniutil.c (L203-L211)
This commit is contained in:
Daniel Hahler
2019-08-02 19:39:29 +02:00
committed by GitHub
parent a270c33b3a
commit 24fb7eefaa

View File

@@ -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,