unibilium
unibilium copied to clipboard
TERMINFO env variable
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.
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"))) {
@mauke can you comment on this and the other pull requests? Or would you consider adding an additional maintainer?
Or would you consider adding an additional maintainer?
FWIW, I would be willing to help out.
I can confirm that this patch works. This repo here seems to be unmaintained. cc @mauke
@justinmk @jamessan Looks like we should fork this into the neovim org?
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.
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