rbavishi / Habitican-Curse

A Terminal application for HabitRPG using the python curses library
MIT License
31 stars 2 forks source link

_curses.error: init_pair() returned ERR #10

Closed 0atman closed 7 years ago

0atman commented 8 years ago

The curses library seems REALLY fragile. It doesn't work using xfce4-terminal:

$ habitican-curse
Traceback (most recent call last):
  File "/usr/bin/habitican-curse", line 45, in <module>
    curses.wrapper(main)
  File "/usr/lib/python2.7/curses/wrapper.py", line 43, in wrapper
    return func(stdscr, *args, **kwds)
  File "/usr/bin/habitican-curse", line 27, in main
    G.screen.Initialize()
  File "/usr/lib/python2.7/site-packages/habitican_curse/screen.py", line 64, in Initialize
    curses.init_pair(C.SCR_COLOR_LIGHT_ORANGE, 209, C.SCR_COLOR_BGRD)
_curses.error: init_pair() returned ERR

Uusing Termite gets a little farther:

[screen clear]

Connecting...

[screen clear]

Traceback (most recent call last):
  File "/usr/bin/habitican-curse", line 45, in <module>
    curses.wrapper(main)
  File "/usr/lib/python2.7/curses/wrapper.py", line 43, in wrapper
    return func(stdscr, *args, **kwds)
  File "/usr/bin/habitican-curse", line 32, in main
    G.intf.Init()
  File "/usr/lib/python2.7/site-packages/habitican_curse/interface.py", line 55, in Init
    G.screen.SaveInRegister(0)
  File "/usr/lib/python2.7/site-packages/habitican_curse/screen.py", line 101, in SaveInRegister
    self.screen.putwin(self.ctxts[register])
_curses.error: putwin() returned ERR

Doesn't even work on xterm...

What's up?

I've installed on python2 on Arch Linux.

0atman commented 8 years ago

VERY keen to use this, screenshots look amazing!

rbavishi commented 8 years ago

Hello! I'm not entirely sure, but I believe the problem with xfce4-terminal atleast is the support for colors. Could you post the output of echo $TERM?

Also could you post the version of the ncurses installed on your system? Thanks a lot!

0atman commented 7 years ago

Can't replicate on ubuntu 17.04 with konsole and tmux - closing, thanks!

RadicalEd360 commented 6 years ago

hello im running into same error while writing my program, from what i can see it happens when setting the color to 8 in xterm, init_pair(1, 8, 2) causes this, any idea how to fix?

0atman commented 6 years ago

¯\_(ツ)_/¯ File a bug on the curses library? Good hunting!