tines
tines copied to clipboard
No reverse video or color on many Arch derivitives
HNB has the same problem. It runs fine on Arch Linux and Chakra. However when I run it on Manjaro Linux or Antergos all text is white and there is no text coloring or revere video. It does not matter if I am using xterm, rxvt, urxvt, lxterminal or gnome-terminal. I am willing to help troubleshoot this, but I have no idea where to even start.
That's weird. Can you find out what version of curses each one uses?
Any version of Arch that works with hnb uses curses 5.9-5. Any version using ncurses 6.0-4 has the bad behavior. If I start out with an older version of any Arch derivative with ncurses 5 everything woks fine, the moment I upgrade to ncurses 6 hnb no longer works correctly.
However on Ubuntu ncurses 6.0+20160213 works just fine with hnb with both hnb and ncurses unpatched.
I have attached a screenshot of what hnb looks like.
I'm going to leave this issue open, because I don't consider it completely solved and it might help someone else if they run into this problem.
After a little research, I see two possible root causes:
- If you compile Tines against ncurses 5.x and run it on a system with 6.0, it will fail because the ABI (application binary interface) changed with 6.0. It's possible to compile ncurses 6.0 to use the 5.x ABI, which could explain why Tines works in some cases.
- (less likely) Some distros might have misconfigured ncurses.
I think the most reliable solution involves including some version of ncurses with Tines and static-linking the library, especially when I get to the point of building binary packages. This might be necessary to completely support UTF-8 as well, because some systems (cough OS X cough) don't compile ncurses with wide-character support.
This sadly makes it impossible to use tines on arch linux, since you never know where the cursor is. By the way: This also happens in hnb
On Arch linux you can install ncurses5-compat-libs
to make both hnb and tines work properly
This issue also shows up on Void Linux. I think it does have something to do with the way ncurses is configured/compiled; compiling with a statically built ncurses 6.0 worked for me and was pretty simple:
- Download
http://ftp.gnu.org/gnu/ncurses/ncurses-6.0.tar.gz
intotines/curses
; extract (so the source lives intines/curses/ncurses-6.0
) -
tines$ cd curses/ncurses-6.0; ./configure --without-cxx --without-cxx-binding --without-ada --without-progs --without-tests --with-abi-version=5 --disable-widec --with-normal; make
- Edit the Makefile. I only had to change the first two lines:
LIBS=libcli/libcli.a ../curses/ncurses-6.0/lib/libncurses.a
CFLAGS=-I. -Ilibcli -I../curses/ncurses-6.0/include -DHAVE_CONFIG_H -Wall -pedantic -g
After that, did make clean
and make
in the src
directory, and ./tines
worked as expected, with color.
Not sure if this actually forces gcc to use the curses.h from my compiled version instead of the global one, but it seems to work either way. I'm also not sure if all those configuration options were really necessary; I got some of them from the abovementioned Arch package's PKGBUILD
. The important one for building it as a static library is --with-normal
(normal as opposed to shared. Thanks stackoverflow.)
I might try to see if it still works without --with-abi-version=5
and --disable-widec
later when I have time.
Other curses programs that use color do work on my system, though, which makes me think there ought to be a way to fix tines
to do so, too, without going through all this. But I have no idea what the real problem is, so this seems to be the easy way out for now.
I've tried again, building with no parameters aside from --with-normal
. It still appeared to work fine.
The reconfigured ncruses did not work for me. However, if you build and install then swap the binaries for a copy of tines
, built statically linked on a Debian based system, it should run near flawlessly on you Arch based system. I ran Debian in a vm and built tines
there, and I can run it on my Manjaro machine now.
In order to build statically I had to change the first line of src/Makefile
to LIBS=-static -lncursesw -ltinfo libcli/libcli.a