Skip to content

Commit

Permalink
unibi_from_term: handle $TERMINFO as curses does #2
Browse files Browse the repository at this point in the history
kitty e.g. sets `$TERMINFO` (at least when using the development version),
but it only contains its own entry for xterm-kitty.

When you start tmux then from there, tmux uses this `$TERMINFO` variable,
and then Neovim would fail to parse `TERM=screen` properly (via
`unibi_from_term`) then.

Fixes mauke#36
  • Loading branch information
blueyed authored and justinmk committed Aug 2, 2019
1 parent e3b16d6 commit 32ab8ef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion doc/unibi_from_term.pod
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ It looks in the following places:
=item 1.

If the environment variable C<TERMINFO> is set, it is interpreted as the name
of the directory to search. No other directory is used.
of the directory to search for local terminal definitions before checking in
the standard place.

=item 2.

Expand Down
5 changes: 4 additions & 1 deletion uniutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,10 @@ unibi_term *unibi_from_term(const char *term) {
}

if ((env = getenv("TERMINFO"))) {
return from_dir(env, NULL, NULL, term);
ut = from_dir(env, NULL, NULL, term);
if (ut) {
return ut;
}
}

if ((env = getenv("HOME"))) {
Expand Down

0 comments on commit 32ab8ef

Please sign in to comment.