tenox7 / ttyplot

a realtime plotting utility for terminal/console with data input from stdin
Apache License 2.0
961 stars 43 forks source link

static ttyplot-amd64-linux aborts with error "Error opening terminal: xterm-256color." #45

Closed emk2203 closed 3 years ago

emk2203 commented 4 years ago

ttyplot-amd64-linux aborts with "Error opening terminal: xterm-256color."

The system has xterm-256color only at /usr/lib/terminfo/x/xterm-256color (Lubuntu install).

A strings /usr/local/bin/ttyplot | grep terminfo shows that the static binary expects it to be at /etc/terminfo:/lib/terminfo:/usr/share/terminfo or ~/.terminfo.

Workaround is to copy it to one of these locations.

Proposed fix: Please add usr/lib/terminfo to the path where ncurses looks for the terminal definition.

tenox7 commented 4 years ago

Interesting. I think the only way to permanently solve it, is to link against a custom build of ncurses with added extra data directories (--datadir or --with-terminfo-dirs).

For a workaround I think simpler may be to specify TERMINFO variable setting it to the correct terminfo folder.

orbatos commented 4 years ago

Setting TERMINFO does not seem to affect the issue at all, whether through tmux or not, and it does not appear to even be checking those hard-coded locations. I attempted to both set valid TERMINFO and provide valid files at the sourced locations, even xterm-256color triggers the error.

This appears (?) to be because ncurses assumes TERMINFO is "broken".

From https://invisible-island.net/ncurses/ncurses-slang.html#env_TERMINFO_DIRS :

While slang's configure script has (since 2007) used the --terminfo option of ncurses scripts ncurses5-config or ncursesw5-config to obtain a suitable default for TERMINFO, it still relies upon a hard-coded set of directories rather using the corresponding --terminfo-dirs option to specify additional directories that ncurses's packager may have found necessary.

nicedreams commented 3 years ago

Been trying to use this for months, but get same error on Debian 10 stable, Sid, MXLinux, Ubuntu 18 and now Ubuntu 20. Any way to resolve this?

tenox7 commented 3 years ago

Sorry I thought this issue was specific to Lubuntu. I have just tried it on Ubuntu 18, 20 and it works fine. But it doesn't work on Debian. Let me see what can be done about it.

nicedreams commented 3 years ago

Currently getting this error on Kubuntu 20.10.

On Sat, Nov 14, 2020 at 8:30 PM Antoni Sawicki notifications@github.com wrote:

Sorry I thought this issue was specific to Lubuntu. I have just tried it on Ubuntu 18, 20 and it works fine. But it doesn't work on Debian. Let me see what can be done about it.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/tenox7/ttyplot/issues/45#issuecomment-727364664, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACQBL3DLID6Q2EPTJXJHE3DSP5DLTANCNFSM4JQA5OZQ .

--

tenox7 commented 3 years ago

whats the location of terminfo database on kubuntu?

tenox7 commented 3 years ago

Can you try this build? You need to gzip -d and chmod +x:

ttyplot-linux-test.gz

emk2203 commented 3 years ago

I have abandoned Lubuntu, but on Kubuntu 21.04 (dev version), it works as expected. terminfo database is at /etc/terminfo and /usr/lib/terminfo, by the way.

nicedreams commented 3 years ago

The ttyplot-linux-test works. Thanks.

Edit: I posted another reply after this one that it wasn't working when using ping, but was conflicting with the old version I forgot to remove from ~/.local/bin

This ttyplot-linux-test is working fine for me on Kubuntu 20.10.

On Sat, Nov 14, 2020 at 10:41 PM Antoni Sawicki notifications@github.com wrote:

Can you try this build? You need to gzip -d and chmod +x:

ttyplot-linux-test.gz https://github.com/tenox7/ttyplot/files/5541894/ttyplot-linux-test.gz

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/tenox7/ttyplot/issues/45#issuecomment-727519092, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACQBL3DZZDP5VHN6CDLTB73SP5SXRANCNFSM4JQA5OZQ .

--

nicedreams commented 3 years ago

Just in case you didn't see the delete and edit of previous post via email I'll send another reply.

ttyplot-linux-test is working. I had a conflict with the older version I tried 2 days ago when did previous post, but it's working on Kubuntu 20.10 now.

tenox7 commented 3 years ago

okay I will make a release with this, thanks for testing!

tenox7 commented 3 years ago

I have updated the release with static build, can you please test again? thanks a lot

nicedreams commented 3 years ago

1) Cloned repo on Debian 10 stable 2) Ran linuxstatic.sh which compiled within docker 3) Tested using ping from Debian 10 stable - working 4) Copied to Ubuntu 20.10 laptop and tried ping again and still working.

On Tue, Nov 17, 2020 at 12:13 PM Antoni Sawicki notifications@github.com wrote:

I have updated the release with static build, can you please test again? thanks a lot

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/tenox7/ttyplot/issues/45#issuecomment-729142146, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACQBL3CVQ2BJHBC3F4ZXXCLSQLDNPANCNFSM4JQA5OZQ .

--

tenox7 commented 3 years ago

Actually if you could test the binary from 1.4 release would be even better:

https://github.com/tenox7/ttyplot/releases/download/1.4/ttyplot-amd64-linux

nicedreams commented 3 years ago

No errors when using your 1.4 link on both Debian 10 and Kbuntu 20.10.

On Tue, Nov 17, 2020 at 2:02 PM Antoni Sawicki notifications@github.com wrote:

Actually if you could test the binary from 1.4 release would be even better:

https://github.com/tenox7/ttyplot/releases/download/1.4/ttyplot-amd64-linux

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/tenox7/ttyplot/issues/45#issuecomment-729211709, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACQBL3FGGJWAQVW3NFA3OMLSQLQGDANCNFSM4JQA5OZQ .

--

tenox7 commented 3 years ago

Thanks a lot for testing! In this case lets close the bug. Please feel free to re-open if needed.

emk2203 commented 3 years ago

Kubuntu 21.04 also OK here.

tenox7 commented 3 years ago

again thanks a lot for all the testing and reporting the issue :)