Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TERMINFO env variable #36

Open
als123 opened this issue Mar 25, 2018 · 7 comments · Fixed by neovim/unibilium#2
Open

TERMINFO env variable #36

als123 opened this issue Mar 25, 2018 · 7 comments · Fixed by neovim/unibilium#2

Comments

@als123
Copy link

als123 commented Mar 25, 2018

The documentation for unibi_from_term() says

If the environment variable "TERMINFO" is set, it is interpreted as the name of the directory to search. No other directory is used.

The curses doc says

If the environment variable TERMINFO is defined, any program using curses checks for a local terminal definition before checking in the standard place.

i.e TERMINFO is a directory containing files which can override one terminal without blocking others. This incompatibility just bit me.

@blueyed
Copy link

blueyed commented Sep 30, 2018

Me also.
kitty 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 fails to parse TERM=screen properly (via unibi_from_term) then.

I suggest the following patch to try other directories if nothing is found via TERMINFO:

diff --git i/uniutil.c w/uniutil.c
index 2e266a7..b9e672c 100644
--- i/uniutil.c
+++ w/uniutil.c
@@ -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"))) {

@justinmk
Copy link

@mauke can you comment on this and the other pull requests? Or would you consider adding an additional maintainer?

@jamessan
Copy link
Contributor

Or would you consider adding an additional maintainer?

FWIW, I would be willing to help out.

@rumpelsepp
Copy link

I can confirm that this patch works. This repo here seems to be unmaintained. cc @mauke

@blueyed
Copy link

blueyed commented Jun 18, 2019

@justinmk @jamessan
Looks like we should fork this into the neovim org?

@leonerd
Copy link
Contributor

leonerd commented Jun 18, 2019

I think at this point that's probably reasonable. mauke hasn't been seen around for a while now so doing something to continue maintaining it would make sense, and best to keep things in one place. I'd be happy to consider neovim's fork to be "next best thing" to official upstream, and continue work there.

blueyed added a commit to blueyed/unibilium that referenced this issue Jun 22, 2019
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.
@blueyed
Copy link

blueyed commented Jun 22, 2019

Ok. We have https://github.com/neovim/unibilium by now (added in February to https://github.com/neovim/neovim/wiki/Deps#forks by @justinmk).
I've turned my patch into a PR there: neovim#2

justinmk pushed a commit to neovim/unibilium that referenced this issue Aug 2, 2019
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants