Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
* [sup-talk] curses exception
@ 2009-10-06 22:33 Dan Falcone
  2009-10-06 23:45 ` Dan Falcone
  2009-10-11 20:30 ` William Morgan
  0 siblings, 2 replies; 9+ messages in thread
From: Dan Falcone @ 2009-10-06 22:33 UTC (permalink / raw)
  To: sup-talk


[-- Attachment #1.1: Type: text/plain, Size: 1182 bytes --]

Hello sup-talk,

I'm trying to get sup running on my work machine, which is unfortunately a
windows box.  I have cygwin installed, along with the cygwin packages for
ruby and ncurses.  Here's the contents of ~/.sup/exception-log.txt:

--- ArgumentError from thread: main
couldn't initialize curses color pair 4, -1 (key 1)
/usr/lib/ruby/gems/1.8/gems/sup-0.9/lib/sup/colormap.rb:133:in `color_for'
/usr/lib/ruby/gems/1.8/gems/sup-0.9/lib/sup/colormap.rb:209:in `send'
/usr/lib/ruby/gems/1.8/gems/sup-0.9/lib/sup/colormap.rb:209:in
`method_missing'
/usr/lib/ruby/gems/1.8/gems/sup-0.9/lib/sup/buffer.rb:116:in `write'
/usr/lib/ruby/gems/1.8/gems/sup-0.9/lib/sup/modes/scroll-mode.rb:51:in
`draw'
/usr/lib/ruby/gems/1.8/gems/sup-0.9/lib/sup/modes/scroll-mode.rb:49:in
`each'
/usr/lib/ruby/gems/1.8/gems/sup-0.9/lib/sup/modes/scroll-mode.rb:49:in
`draw'
/usr/lib/ruby/gems/1.8/gems/sup-0.9/lib/sup/modes/line-cursor-mode.rb:37:in
`dra
w'
/usr/lib/ruby/gems/1.8/gems/sup-0.9/lib/sup/buffer.rb:106:in `draw'
/usr/lib/ruby/gems/1.8/gems/sup-0.9/lib/sup/buffer.rb:327:in `draw_screen'
/usr/lib/ruby/gems/1.8/gems/sup-0.9/bin/sup:183
/usr/bin/sup:19:in `load'
/usr/bin/sup:19


Thanks!
Dan

[-- Attachment #1.2: Type: text/html, Size: 1322 bytes --]

[-- Attachment #2: Type: text/plain, Size: 140 bytes --]

_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [sup-talk] curses exception
  2009-10-06 22:33 [sup-talk] curses exception Dan Falcone
@ 2009-10-06 23:45 ` Dan Falcone
  2009-10-11 20:30 ` William Morgan
  1 sibling, 0 replies; 9+ messages in thread
From: Dan Falcone @ 2009-10-06 23:45 UTC (permalink / raw)
  To: sup-talk


[-- Attachment #1.1: Type: text/plain, Size: 1348 bytes --]

Resending as a list member...

On Tue, Oct 6, 2009 at 6:33 PM, Dan Falcone <danfalcone@gmail.com> wrote:

> Hello sup-talk,
>
> I'm trying to get sup running on my work machine, which is unfortunately a
> windows box.  I have cygwin installed, along with the cygwin packages for
> ruby and ncurses.  Here's the contents of ~/.sup/exception-log.txt:
>
> --- ArgumentError from thread: main
> couldn't initialize curses color pair 4, -1 (key 1)
> /usr/lib/ruby/gems/1.8/gems/sup-0.9/lib/sup/colormap.rb:133:in `color_for'
> /usr/lib/ruby/gems/1.8/gems/sup-0.9/lib/sup/colormap.rb:209:in `send'
> /usr/lib/ruby/gems/1.8/gems/sup-0.9/lib/sup/colormap.rb:209:in
> `method_missing'
> /usr/lib/ruby/gems/1.8/gems/sup-0.9/lib/sup/buffer.rb:116:in `write'
> /usr/lib/ruby/gems/1.8/gems/sup-0.9/lib/sup/modes/scroll-mode.rb:51:in
> `draw'
> /usr/lib/ruby/gems/1.8/gems/sup-0.9/lib/sup/modes/scroll-mode.rb:49:in
> `each'
> /usr/lib/ruby/gems/1.8/gems/sup-0.9/lib/sup/modes/scroll-mode.rb:49:in
> `draw'
> /usr/lib/ruby/gems/1.8/gems/sup-0.9/lib/sup/modes/line-cursor-mode.rb:37:in
> `dra
> w'
> /usr/lib/ruby/gems/1.8/gems/sup-0.9/lib/sup/buffer.rb:106:in `draw'
> /usr/lib/ruby/gems/1.8/gems/sup-0.9/lib/sup/buffer.rb:327:in `draw_screen'
> /usr/lib/ruby/gems/1.8/gems/sup-0.9/bin/sup:183
> /usr/bin/sup:19:in `load'
> /usr/bin/sup:19
>
>
> Thanks!
> Dan
>

[-- Attachment #1.2: Type: text/html, Size: 1727 bytes --]

[-- Attachment #2: Type: text/plain, Size: 140 bytes --]

_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [sup-talk] curses exception
  2009-10-06 22:33 [sup-talk] curses exception Dan Falcone
  2009-10-06 23:45 ` Dan Falcone
@ 2009-10-11 20:30 ` William Morgan
  2009-10-12 14:09   ` Dan Falcone
  1 sibling, 1 reply; 9+ messages in thread
From: William Morgan @ 2009-10-11 20:30 UTC (permalink / raw)
  To: sup-talk

Reformatted excerpts from Dan Falcone's message of 2009-10-06:
> I'm trying to get sup running on my work machine, which is unfortunately a
> windows box.  I have cygwin installed, along with the cygwin packages for
> ruby and ncurses.  Here's the contents of ~/.sup/exception-log.txt:
> 
> --- ArgumentError from thread: main
> couldn't initialize curses color pair 4, -1 (key 1)
> /usr/lib/ruby/gems/1.8/gems/sup-0.9/lib/sup/colormap.rb:133:in `color_for'

Weird. We've had other people get it working on Cygwin before, I
believe. Are you running this within Cygwin's rxvt?

What if you modify lib/sup/colormap.rb so that NUM_COLORS=15?
-- 
William <wmorgan-sup@masanjin.net>
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [sup-talk] curses exception
  2009-10-11 20:30 ` William Morgan
@ 2009-10-12 14:09   ` Dan Falcone
  2009-10-15 12:51     ` William Morgan
  0 siblings, 1 reply; 9+ messages in thread
From: Dan Falcone @ 2009-10-12 14:09 UTC (permalink / raw)
  To: William Morgan; +Cc: sup-talk


[-- Attachment #1.1: Type: text/plain, Size: 1390 bytes --]

Normally I use puttycyg (http://code.google.com/p/puttycyg/), but I gave
rxvt and even the normal cmd.exe window a try.  Same error in all three.  I
also tried modifying NUM_COLORS to 15 (and other values... 1, 8, 16, 32) but
got the same error every time in each terminal emulator.

Honestly, it's probably an issue with my setup... is there a guide anywhere
on how to get sup running in cygwin?  Maybe I'm missing a required package?

Thanks!
Dan

On Sun, Oct 11, 2009 at 4:30 PM, William Morgan <wmorgan-sup@masanjin.net>wrote:

> Reformatted excerpts from Dan Falcone's message of 2009-10-06:
> > I'm trying to get sup running on my work machine, which is unfortunately
> a
> > windows box.  I have cygwin installed, along with the cygwin packages for
> > ruby and ncurses.  Here's the contents of ~/.sup/exception-log.txt:
> >
> > --- ArgumentError from thread: main
> > couldn't initialize curses color pair 4, -1 (key 1)
> > /usr/lib/ruby/gems/1.8/gems/sup-0.9/lib/sup/colormap.rb:133:in
> `color_for'
>
> Weird. We've had other people get it working on Cygwin before, I
> believe. Are you running this within Cygwin's rxvt?
>
> What if you modify lib/sup/colormap.rb so that NUM_COLORS=15?
> --
> William <wmorgan-sup@masanjin.net>
> _______________________________________________
> sup-talk mailing list
> sup-talk@rubyforge.org
> http://rubyforge.org/mailman/listinfo/sup-talk
>

[-- Attachment #1.2: Type: text/html, Size: 2057 bytes --]

[-- Attachment #2: Type: text/plain, Size: 140 bytes --]

_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [sup-talk] curses exception
  2009-10-12 14:09   ` Dan Falcone
@ 2009-10-15 12:51     ` William Morgan
  2009-10-15 14:40       ` Dan Falcone
  0 siblings, 1 reply; 9+ messages in thread
From: William Morgan @ 2009-10-15 12:51 UTC (permalink / raw)
  To: sup-talk

Reformatted excerpts from Dan Falcone's message of 2009-10-12:
> Honestly, it's probably an issue with my setup... is there a guide
> anywhere on how to get sup running in cygwin?  Maybe I'm missing a
> required package?

There's no guide per se. Other people have definitely made it work in
the past. Are you able to get other color curses programs to work? I
suspect it's not a Sup issue per se, but I'm not that familiar with the
intricacies of Cygwin.
-- 
William <wmorgan-sup@masanjin.net>
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [sup-talk] curses exception
  2009-10-15 12:51     ` William Morgan
@ 2009-10-15 14:40       ` Dan Falcone
  2009-10-15 15:27         ` William Morgan
  0 siblings, 1 reply; 9+ messages in thread
From: Dan Falcone @ 2009-10-15 14:40 UTC (permalink / raw)
  To: William Morgan; +Cc: sup-talk


[-- Attachment #1.1: Type: text/plain, Size: 1113 bytes --]

Hmm... good question.  I regularly use emacs with colors enabled, but I'm
not sure if that uses curses.  I tried typespeed and that seemed to work.
According to its man page, it uses curses.  Is there any way I could disable
colors in sup as a test?  I'll also try reinstalling curses and installing
older versions to see if that makes a difference...

Thanks!
Dan

On Thu, Oct 15, 2009 at 8:51 AM, William Morgan <wmorgan-sup@masanjin.net>wrote:

> Reformatted excerpts from Dan Falcone's message of 2009-10-12:
> > Honestly, it's probably an issue with my setup... is there a guide
> > anywhere on how to get sup running in cygwin?  Maybe I'm missing a
> > required package?
>
> There's no guide per se. Other people have definitely made it work in
> the past. Are you able to get other color curses programs to work? I
> suspect it's not a Sup issue per se, but I'm not that familiar with the
> intricacies of Cygwin.
> --
> William <wmorgan-sup@masanjin.net>
> _______________________________________________
> sup-talk mailing list
> sup-talk@rubyforge.org
> http://rubyforge.org/mailman/listinfo/sup-talk
>

[-- Attachment #1.2: Type: text/html, Size: 1743 bytes --]

[-- Attachment #2: Type: text/plain, Size: 140 bytes --]

_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [sup-talk] curses exception
  2009-10-15 14:40       ` Dan Falcone
@ 2009-10-15 15:27         ` William Morgan
  2010-01-15 19:49           ` Dan Falcone
  0 siblings, 1 reply; 9+ messages in thread
From: William Morgan @ 2009-10-15 15:27 UTC (permalink / raw)
  To: sup-talk

Reformatted excerpts from Dan Falcone's message of 2009-10-15:
> Hmm... good question.  I regularly use emacs with colors enabled, but
> I'm not sure if that uses curses.  I tried typespeed and that seemed
> to work.  According to its man page, it uses curses.

Hm. What version of the ncurses gem do you have? (gem list --local
should tell you.)

What does this program print?

  require 'rubygems'
  require 'ncurses'

  x = begin
    Ncurses::initscr();
    Ncurses::has_colors?()
  ensure
    Ncurses::endwin();
  end

  puts x

If it prints true, then, if you look in the contents of the gem
(wherever that is on your system), there should be an examples/
directory. If you run examples/tlock.rb or examples/rain.rb, (probably
with ruby -rubygems), do you see color?
-- 
William <wmorgan-sup@masanjin.net>
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [sup-talk] curses exception
  2009-10-15 15:27         ` William Morgan
@ 2010-01-15 19:49           ` Dan Falcone
  2010-02-22 15:41             ` Dan Falcone
  0 siblings, 1 reply; 9+ messages in thread
From: Dan Falcone @ 2010-01-15 19:49 UTC (permalink / raw)
  To: William Morgan; +Cc: sup-talk


[-- Attachment #1.1: Type: text/plain, Size: 2262 bytes --]

Hi William,

Sorry I didn't get back to you sooner.  I finally got back around to playing
with this again.  Here are the answers to your questions:

>gem list --local | grep curse
ncurses (0.9.1)

The test script prints:
true

The ncurses examples all seem to work and display color.  I did have to edit
them to add require 'rubygems' at the top.

I also tried playing with the sup code a bit.  If I comment out lines 133-4
in lib/sup/colormap.rb:

#      Curses.init_pair id, fg, bg or raise ArgumentError,
#       "couldn't initialize curses color pair #{fg}, #{bg} (key #{id})"

sup loads, but everything is in black and white and a bit difficult to
read.  I also tried uncommenting that, then changing Curses to Ncurses so it
looks like this:

      Nurses.init_pair id, fg, bg or raise ArgumentError,
       "couldn't initialize curses color pair #{fg}, #{bg} (key #{id})"

sup loads with that as well, and displays some color, but most of the screen
is unreadable (I'm guessing it's displaying as white text on white
background).

Any ideas?  I tried changing more things from Curses to Ncurses, but that
quickly started generating method undefined errors.

Thanks!
Dan


On Thu, Oct 15, 2009 at 11:27 AM, William Morgan
<wmorgan-sup@masanjin.net>wrote:

> Reformatted excerpts from Dan Falcone's message of 2009-10-15:
> > Hmm... good question.  I regularly use emacs with colors enabled, but
> > I'm not sure if that uses curses.  I tried typespeed and that seemed
> > to work.  According to its man page, it uses curses.
>
> Hm. What version of the ncurses gem do you have? (gem list --local
> should tell you.)
>
> What does this program print?
>
>  require 'rubygems'
>  require 'ncurses'
>
>  x = begin
>    Ncurses::initscr();
>    Ncurses::has_colors?()
>  ensure
>    Ncurses::endwin();
>  end
>
>  puts x
>
> If it prints true, then, if you look in the contents of the gem
> (wherever that is on your system), there should be an examples/
> directory. If you run examples/tlock.rb or examples/rain.rb, (probably
> with ruby -rubygems), do you see color?
> --
> William <wmorgan-sup@masanjin.net>
> _______________________________________________
> sup-talk mailing list
> sup-talk@rubyforge.org
> http://rubyforge.org/mailman/listinfo/sup-talk
>

[-- Attachment #1.2: Type: text/html, Size: 3137 bytes --]

[-- Attachment #2: Type: text/plain, Size: 140 bytes --]

_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [sup-talk] curses exception
  2010-01-15 19:49           ` Dan Falcone
@ 2010-02-22 15:41             ` Dan Falcone
  0 siblings, 0 replies; 9+ messages in thread
From: Dan Falcone @ 2010-02-22 15:41 UTC (permalink / raw)
  To: William Morgan; +Cc: sup-talk


[-- Attachment #1.1: Type: text/plain, Size: 2473 bytes --]

Just checking on this...

On Fri, Jan 15, 2010 at 2:49 PM, Dan Falcone <danfalcone@gmail.com> wrote:

> Hi William,
>
> Sorry I didn't get back to you sooner.  I finally got back around to
> playing with this again.  Here are the answers to your questions:
>
> >gem list --local | grep curse
> ncurses (0.9.1)
>
> The test script prints:
> true
>
> The ncurses examples all seem to work and display color.  I did have to
> edit them to add require 'rubygems' at the top.
>
> I also tried playing with the sup code a bit.  If I comment out lines 133-4
> in lib/sup/colormap.rb:
>
> #      Curses.init_pair id, fg, bg or raise ArgumentError,
> #       "couldn't initialize curses color pair #{fg}, #{bg} (key #{id})"
>
> sup loads, but everything is in black and white and a bit difficult to
> read.  I also tried uncommenting that, then changing Curses to Ncurses so it
> looks like this:
>
>       Nurses.init_pair id, fg, bg or raise ArgumentError,
>        "couldn't initialize curses color pair #{fg}, #{bg} (key #{id})"
>
> sup loads with that as well, and displays some color, but most of the
> screen is unreadable (I'm guessing it's displaying as white text on white
> background).
>
> Any ideas?  I tried changing more things from Curses to Ncurses, but that
> quickly started generating method undefined errors.
>
> Thanks!
> Dan
>
>
>
> On Thu, Oct 15, 2009 at 11:27 AM, William Morgan <wmorgan-sup@masanjin.net
> > wrote:
>
>> Reformatted excerpts from Dan Falcone's message of 2009-10-15:
>> > Hmm... good question.  I regularly use emacs with colors enabled, but
>> > I'm not sure if that uses curses.  I tried typespeed and that seemed
>> > to work.  According to its man page, it uses curses.
>>
>> Hm. What version of the ncurses gem do you have? (gem list --local
>> should tell you.)
>>
>> What does this program print?
>>
>>  require 'rubygems'
>>  require 'ncurses'
>>
>>  x = begin
>>    Ncurses::initscr();
>>    Ncurses::has_colors?()
>>  ensure
>>    Ncurses::endwin();
>>  end
>>
>>  puts x
>>
>> If it prints true, then, if you look in the contents of the gem
>> (wherever that is on your system), there should be an examples/
>> directory. If you run examples/tlock.rb or examples/rain.rb, (probably
>> with ruby -rubygems), do you see color?
>> --
>> William <wmorgan-sup@masanjin.net>
>> _______________________________________________
>> sup-talk mailing list
>> sup-talk@rubyforge.org
>> http://rubyforge.org/mailman/listinfo/sup-talk
>>
>
>

[-- Attachment #1.2: Type: text/html, Size: 3584 bytes --]

[-- Attachment #2: Type: text/plain, Size: 140 bytes --]

_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-02-22 15:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-06 22:33 [sup-talk] curses exception Dan Falcone
2009-10-06 23:45 ` Dan Falcone
2009-10-11 20:30 ` William Morgan
2009-10-12 14:09   ` Dan Falcone
2009-10-15 12:51     ` William Morgan
2009-10-15 14:40       ` Dan Falcone
2009-10-15 15:27         ` William Morgan
2010-01-15 19:49           ` Dan Falcone
2010-02-22 15:41             ` Dan Falcone

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox