Stebalien / term

A Rust library for terminfo parsing and terminal colors.
https://stebalien.github.io/doc/term/term/
Apache License 2.0
178 stars 49 forks source link

Fix terminfo database search path #66

Closed meh closed 7 years ago

meh commented 7 years ago

This is more consistent with what every other program does, I happened to have TERMINFO set as /usr/share/terminfo but had the actual database in ~/.terminfo, regardless of that every other terminfo/ncurses based software picked up the one in the home correctly.

This just puts the path in TERMINFO at the top of the search paths, and moves the home checking to the default search paths section.

Stebalien commented 7 years ago

I could have sworn I left a comment here but I guess I never posted it...

To the best of my understanding, this crate currently follows the search logic laid out in the terminfo manual which says:

If the environment variable TERMINFO is set, it is interpreted as the pathname of a directory containing the compiled description you are working on. Only that directory is searched.

Does ncurses ignore this?

Stebalien commented 7 years ago

Ah, yes. The ncurses manual disagrees:

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

Stebalien commented 7 years ago

Thanks!

meh commented 7 years ago

My bad, there's a typo in this pull request that fails CI, I fixed it on the pull request in rustc and forgot to apply the fix here 🐼

Stebalien commented 7 years ago

Np. Sorry for ignoring this for so long. I kept on telling myself that I was going to finish term 0.5 (a big breaking change) soon so I held off on fixing bugs in the current one. TL;DR, it's taking a while...