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

Ruby 2 at Mac OS X: couldn't initialize curses color pair 4 #191

Closed
timonv opened this issue Nov 26, 2013 · 18 comments
Closed

Ruby 2 at Mac OS X: couldn't initialize curses color pair 4 #191

timonv opened this issue Nov 26, 2013 · 18 comments
Labels

Comments

@timonv
Copy link
Contributor

timonv commented Nov 26, 2013

Hey guys,

Fresh install of supmua, and I get this error.

# Term and colors
± % env | grep color                                                                                                                                                                                     
TERM=xterm-256color
GREP_OPTIONS=--color=auto
ZSH_TMUX_TERM=screen-256color

# Path, sorry about the rbenv, didn't know
/usr/local/sbin:/usr/local/bin:/usr/local/opt/rbenv/shims:/usr/local/opt/rbenv/bin:/usr/local/opt/rbenv/shims:/usr/local/opt/rbenv/bin:/usr/local/opt/rbenv/shims:/usr/local/opt/rbenv/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/MacGPG2/bin:/usr/local/opt/rbenv/shims:/Users/timonv/.rbenv/bin:/usr/local/heroku/bin:/usr/X11/bin:/Users/timonv/Dropbox/Projects/go_projects/bin:/usr/local/opt/rbenv/bin:/Users/timonv/.rbenv/shims:/Users/timonv/Library/Python/2.7/bin:/usr/local/share/npm/bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/MacGPG2/bin:/usr/local/opt/rbenv/shims:/Users/timonv/.rbenv/bin:/usr/local/heroku/bin:/usr/X11/bin:/Users/timonv/Dropbox/Projects/go_projects/bin:/usr/local/opt/rbenv/bin:/Users/timonv/.rbenv/shims:/Users/timonv/Library/Python/2.7/bin:/usr/local/share/npm/bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/MacGPG2/bin:/usr/local/opt/rbenv/shims:/Users/timonv/.rbenv/bin:/usr/local/heroku/bin:/usr/X11/bin:/Users/timonv/Dropbox/Projects/go_projects/bin:/usr/local/opt/rbenv/bin:/Users/timonv/.rbenv/shims:/Users/timonv/Library/Python/2.7/bin:/usr/local/share/npm/bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/MacGPG2/bin:/usr/local/opt/rbenv/shims:/Users/timonv/.rbenv/bin:/usr/local/heroku/bin:/usr/X11/bin:/Users/timonv/Dropbox/Projects/go_projects/bin:/usr/local/opt/rbenv/bin:/Users/timonv/.rbenv/shims:/Users/timonv/Library/Python/2.7/bin:/usr/local/share/npm/bin/

Ncurses version is latest 5.9 from brew.

# Backtrace
[2013-11-26 20:28:31 +0100] ERROR: oh crap, an exception
----------------------------------------------------------------
We are very sorry. It seems that an error occurred in Sup. Please
accept our sincere apologies. Please submit the contents of
/Users/timonv/.sup/exception-log.txt and a brief report of the
circumstances to https://github.com/sup-heliotrope/sup/issues so that
we might address this problem. Thank you!

Sincerely,
The Sup Developers
----------------------------------------------------------------
--- ArgumentError from thread: main
couldn't initialize curses color pair 4, -1 (key 1)
/usr/local/opt/rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/sup-0.15.0/lib/sup/colormap.rb:160:in `color_for'
/usr/local/opt/rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/sup-0.15.0/lib/sup/colormap.rb:230:in `color_for'
/usr/local/opt/rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/sup-0.15.0/lib/sup/buffer.rb:128:in `write'
/usr/local/opt/rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/sup-0.15.0/lib/sup/modes/scroll_mode.rb:49:in `block in draw'
/usr/local/opt/rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/sup-0.15.0/lib/sup/modes/scroll_mode.rb:47:in `each'
/usr/local/opt/rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/sup-0.15.0/lib/sup/modes/scroll_mode.rb:47:in `draw'
/usr/local/opt/rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/sup-0.15.0/lib/sup/modes/line_cursor_mode.rb:37:in `draw'
/usr/local/opt/rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/sup-0.15.0/lib/sup/buffer.rb:118:in `draw'
/usr/local/opt/rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/sup-0.15.0/lib/sup/buffer.rb:335:in `draw_screen'
/usr/local/opt/rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/sup-0.15.0/bin/sup:205:in `<module:Redwood>'
/usr/local/opt/rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/sup-0.15.0/bin/sup:73:in `<top (required)>'
/usr/local/opt/rbenv/versions/2.0.0-p247/bin/sup:23:in `load'
/usr/local/opt/rbenv/versions/2.0.0-p247/bin/sup:23:in `<main>'
@gauteh
Copy link
Member

gauteh commented Nov 26, 2013

Weird, do you have a custom colormap.rb in: ~/.sup? Do you get this error when you try to start Sup the first time or do you do something else? Could you please turn on debugging: export SUP_LOG_LEVEL=debug and try again so that we'll get some more output.

Thanks, gaute

@timonv
Copy link
Contributor Author

timonv commented Nov 27, 2013

SUP_LOG_LEVEL=debug sup                                                                                                                                                                              !10200
[2013-11-27 10:16:43 +0100] using character set encoding "UTF-8"
[2013-11-27 10:16:43 +0100] No 'gpgme' gem detected. Install it for email encryption, decryption and signatures.
[2013-11-27 10:16:43 +0100] WARNING: DL is deprecated, please use Fiddle
[2013-11-27 10:16:43 +0100] dynamically loading setlocale() from libc.dylib
[2013-11-27 10:16:43 +0100] setting locale...
[2013-11-27 10:16:43 +0100] locking /Users/timonv/.sup/lock...
[2013-11-27 10:16:43 +0100] no draft source, auto-adding...
[2013-11-27 10:16:43 +0100] starting curses
[2013-11-27 10:16:43 +0100] stopped cursing
[2013-11-27 10:16:43 +0100] ERROR: oh crap, an exception
[2013-11-27 10:16:43 +0100] unlocking /Users/timonv/.sup/lock...
----------------------------------------------------------------
We are very sorry. It seems that an error occurred in Sup. Please
accept our sincere apologies. Please submit the contents of
/Users/timonv/.sup/exception-log.txt and a brief report of the
circumstances to https://github.com/sup-heliotrope/sup/issues so that
we might address this problem. Thank you!

Sincerely,
The Sup Developers
----------------------------------------------------------------
--- ArgumentError from thread: main
couldn't initialize curses color pair 4, -1 (key 1)
/usr/local/opt/rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/sup-0.15.0/lib/sup/colormap.rb:160:in `color_for'
/usr/local/opt/rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/sup-0.15.0/lib/sup/colormap.rb:230:in `color_for'
/usr/local/opt/rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/sup-0.15.0/lib/sup/buffer.rb:128:in `write'
/usr/local/opt/rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/sup-0.15.0/lib/sup/modes/scroll_mode.rb:49:in `block in draw'
/usr/local/opt/rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/sup-0.15.0/lib/sup/modes/scroll_mode.rb:47:in `each'
/usr/local/opt/rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/sup-0.15.0/lib/sup/modes/scroll_mode.rb:47:in `draw'
/usr/local/opt/rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/sup-0.15.0/lib/sup/modes/line_cursor_mode.rb:37:in `draw'
/usr/local/opt/rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/sup-0.15.0/lib/sup/buffer.rb:118:in `draw'
/usr/local/opt/rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/sup-0.15.0/lib/sup/buffer.rb:335:in `draw_screen'
/usr/local/opt/rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/sup-0.15.0/bin/sup:205:in `<module:Redwood>'
/usr/local/opt/rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/sup-0.15.0/bin/sup:73:in `<top (required)>'
/usr/local/opt/rbenv/versions/2.0.0-p247/bin/sup:23:in `load'
/usr/local/opt/rbenv/versions/2.0.0-p247/bin/sup:23:in `<main>'

As for special setups, I'm running ZSH in iterm2 (custom colors in iterm), wrapped in tmux. Obviously on a mac.

@gauteh
Copy link
Member

gauteh commented Nov 27, 2013

  • When does the error happen?
  • Can you also post the relevant parts of your ~/.sup/log file?

@timonv
Copy link
Contributor Author

timonv commented Nov 27, 2013

When does the error happen?

When firing up sup. Bare install as via the gmail + macosx tutorial. Also, I tried setting the color profile in my term back to default, using bare bash, no tmux and setting TERM=screen-256color

LANG is btw set to utf-8 across my terminal. Could that have negatively affected the ncurses compile some how, I don't know, like mapping the wrong color codes to the wrong colors? I'm just yak shaving here.

[2013-11-27 10:16:43 +0100] dynamically loading setlocale() from libc.dylib
[2013-11-27 10:16:43 +0100] setting locale...
[2013-11-27 10:16:43 +0100] locking /Users/timonv/.sup/lock...
[2013-11-27 10:16:43 +0100] no draft source, auto-adding...
[2013-11-27 10:16:43 +0100] starting curses
[2013-11-27 10:16:43 +0100] initializing log buffer
[2013-11-27 10:16:43 +0100] Welcome to Sup! Log level is set to debug.
[2013-11-27 10:16:43 +0100] initializing inbox buffer
[2013-11-27 10:16:43 +0100] ready for interaction!
[2013-11-27 10:16:43 +0100] colormap: for color twiddle_color, using id 1 -> 4, -1
[2013-11-27 10:20:48 +0100] No 'gpgme' gem detected. Install it for email encryption, decryption and signatures.
[2013-11-27 10:20:48 +0100] WARNING: DL is deprecated, please use Fiddle
[2013-11-27 10:20:48 +0100] Welcome to Sup! Log level is set to info.
[2013-11-27 10:20:48 +0100] For more verbose logging, restart with SUP_LOG_LEVEL=debug.
[2013-11-27 10:21:27 +0100] No 'gpgme' gem detected. Install it for email encryption, decryption and signatures.
[2013-11-27 10:21:27 +0100] WARNING: DL is deprecated, please use Fiddle
[2013-11-27 10:21:27 +0100] Welcome to Sup! Log level is set to info.
[2013-11-27 10:21:27 +0100] For more verbose logging, restart with SUP_LOG_LEVEL=debug.
[2013-11-27 10:22:01 +0100] No 'gpgme' gem detected. Install it for email encryption, decryption and signatures.
[2013-11-27 10:22:01 +0100] WARNING: DL is deprecated, please use Fiddle
[2013-11-27 10:22:01 +0100] Welcome to Sup! Log level is set to info.
[2013-11-27 10:22:01 +0100] For more verbose logging, restart with SUP_LOG_LEVEL=debug.

@gauteh
Copy link
Member

gauteh commented Nov 27, 2013

Excerpts from Timon Vonk's message of 2013-11-27 10:29:14 +0100:

When does the error happen?
When firing up sup. Bare install as via the gmail + macosx tutorial. Also, I tried setting the color profile in my term back to default, using bare bash, no tmux and setting TERM=screen-256color

LANG is btw set to utf-8 across my terminal. Could that have negatively affected the ncurses compile some how, I don't know, like mapping the wrong color codes to the wrong colors? I'm just yak shaving here.

yak should be shaved, utf-8 is the way to go. shouldn't be a problem: as
far as I know color pairs are still integers.

could you try with just plain mac os x Terminal.app and no other special
setup stuff?

what version of Mac OS X do you run? did you do the 'brew link ncurses'
stage before installing the ncursesw-sup gem as well? there might be
some ncurses color test programs out there (possibly as part of
ncurses), maybe you could check if that works.

I can't test much more right now.

  • gaute

@timonv
Copy link
Contributor Author

timonv commented Nov 27, 2013

could you try with just plain mac os x Terminal.app and no other special
setup stuff?

Disabled as much as I could, nothing :(

what version of Mac OS X do you run? did you do the 'brew link ncurses'
stage before installing the ncursesw-sup gem as well? there might be
some ncurses color test programs out there (possibly as part of
ncurses), maybe you could check if that works.

Mavericks, all linked well. Also tried a relink and a gem pristine ncursesw-sup, didn't work. No errors either. I'll get on the color test programs.

@gauteh
Copy link
Member

gauteh commented Nov 27, 2013

Ok, I run pretty much the same setup as you. Except I use Ruby 1.9.3 through RVM, maybe worth a shot? I also have all Xcode CLI tools, but you probably needed to install that yourself?

The correct, wide char supporting, ncurses must be installed and linked (--force) before the gem is installed. Doing a pristine install should have taken care of that anyway (you could try to do brew doctor before installing the gem as well).

@schmeisers
Copy link

I run a setup very similar (Mavericks, iTerm2, tmux) and had the same issue until I switched to using Ruby 1.9.3.

Steve

could you try with just plain mac os x Terminal.app and no other special
setup stuff?

Disabled as much as I could, nothing :(

what version of Mac OS X do you run? did you do the 'brew link ncurses'
stage before installing the ncursesw-sup gem as well? there might be
some ncurses color test programs out there (possibly as part of
ncurses), maybe you could check if that works.

Mavericks, all linked well. Also tried a relink and a gem pristine ncursesw-sup, didn't work. No errors either. I'll get on the color test programs.


Reply to this email directly or view it on GitHub:
#191 (comment)

@timonv
Copy link
Contributor Author

timonv commented Nov 27, 2013

I run a setup very similar (Mavericks, iTerm2, tmux) and had the same issue until I switched to using Ruby 1.9.3.

No. Way.

That did it.

@gauteh
Copy link
Member

gauteh commented Nov 27, 2013

Excerpts from Timon Vonk's message of 2013-11-27 14:58:29 +0100:

I run a setup very similar (Mavericks, iTerm2, tmux) and had the same issue until I switched to using Ruby 1.9.3.

No. Way.

That did it.

Cool.

So it is a Ruby 2.0.0 Mac OS X specific issue 😀

  • gaute

@timonv
Copy link
Contributor Author

timonv commented Nov 27, 2013

There's such a thing as oss continuous integration servers.

@gauteh
Copy link
Member

gauteh commented Nov 27, 2013

There's such a thing as oss continuous integration servers.

We do have some testing using Travis (including Ruby 2.0.0), but not
really testing anything curses. And nothing at all on the Mac OS X platform.

@timonv
Copy link
Contributor Author

timonv commented Nov 27, 2013

We do have some testing using Travis (including Ruby 2.0.0), but not
really testing anything curses. And nothing at all on the Mac OS X platform.

Cool! Thanks for the help @gauteh and @k2enemy ! Closing this. A remark in the readme and/or osx install instructions would be awesome!

@timonv timonv closed this as completed Nov 27, 2013
@gauteh
Copy link
Member

gauteh commented Nov 27, 2013

Excerpts from Timon Vonk's message of 2013-11-27 15:21:53 +0100:

We do have some testing using Travis (including Ruby 2.0.0), but not
really testing anything curses. And nothing at all on the Mac OS X platform.

Cool! Thanks for the help @gauteh and @k2enemy ! Closing this. A remark in the readme and/or osx install instructions would be awesome!

sure! help yourself to the wiki ;)

we could probably keep this open. it should be fixed at some point.

@gauteh gauteh reopened this Nov 27, 2013
@timonv
Copy link
Contributor Author

timonv commented Nov 27, 2013

sure! help yourself to the wiki ;)

we could probably keep this open. it should be fixed at some point.

Sure, thanks! But isn't it more likely a bug in ncsursesw-sup?

@gauteh
Copy link
Member

gauteh commented Nov 27, 2013

Excerpts from Timon Vonk's message of 2013-11-27 15:44:21 +0100:

sure! help yourself to the wiki ;)

we could probably keep this open. it should be fixed at some point.

Sure, thanks! But isn't it more likely a bug in ncsursesw-sup?

that could be.. but it breaks Sup so I think it should be kept open anyway.

@timonv
Copy link
Contributor Author

timonv commented Jul 13, 2014

FYI running on 2.1.2 and all is good.

@gauteh
Copy link
Member

gauteh commented Jul 13, 2014

Aight! Thanks for letting me know!

gauteh added a commit that referenced this issue Mar 14, 2015
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

3 participants