Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No reverse video or color on many Arch derivitives #5

Open
fwarren opened this issue Feb 24, 2016 · 8 comments
Open

No reverse video or color on many Arch derivitives #5

fwarren opened this issue Feb 24, 2016 · 8 comments
Assignees
Labels

Comments

@fwarren
Copy link

fwarren commented Feb 24, 2016

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.

@larrykollar
Copy link
Owner

That's weird. Can you find out what version of curses each one uses?

@fwarren
Copy link
Author

fwarren commented Feb 26, 2016

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.

hnb

@larrykollar
Copy link
Owner

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.

@larrykollar larrykollar self-assigned this Mar 1, 2016
@larrykollar larrykollar added the bug label Mar 1, 2016
@carnager
Copy link

carnager commented Aug 7, 2016

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

@fwarren
Copy link
Author

fwarren commented Aug 7, 2016

On Arch linux you can install ncurses5-compat-libs to make both hnb and tines work properly

@autumn-birds
Copy link

autumn-birds commented Jan 6, 2018

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 into tines/curses; extract (so the source lives in tines/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.

@autumn-birds
Copy link

I've tried again, building with no parameters aside from --with-normal. It still appeared to work fine.

@aThorp96
Copy link

aThorp96 commented May 11, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants