unibilium icon indicating copy to clipboard operation
unibilium copied to clipboard

TERMINFO env variable

Open als123 opened this issue 6 years ago • 7 comments

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.

als123 avatar Mar 25 '18 08:03 als123

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"))) {

blueyed avatar Sep 30 '18 15:09 blueyed

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

justinmk avatar Nov 13 '18 18:11 justinmk

Or would you consider adding an additional maintainer?

FWIW, I would be willing to help out.

jamessan avatar Nov 13 '18 22:11 jamessan

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

rumpelsepp avatar Apr 01 '19 05:04 rumpelsepp

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

blueyed avatar Jun 18 '19 05:06 blueyed

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.

leonerd avatar Jun 18 '19 11:06 leonerd

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: https://github.com/neovim/unibilium/pull/2

blueyed avatar Jun 22 '19 18:06 blueyed