From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.213.7.146 with SMTP id d18cs250323ebd; Fri, 15 Jan 2010 11:56:49 -0800 (PST) Received: by 10.224.35.101 with SMTP id o37mr2574676qad.25.1263585408340; Fri, 15 Jan 2010 11:56:48 -0800 (PST) Return-Path: Received: from rubyforge.org (rubyforge.org [205.234.109.19]) by mx.google.com with ESMTP id 8si5622001qwj.33.2010.01.15.11.56.47; Fri, 15 Jan 2010 11:56:48 -0800 (PST) Received-SPF: pass (google.com: domain of sup-talk-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) client-ip=205.234.109.19; Authentication-Results: mx.google.com; spf=pass (google.com: domain of sup-talk-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) smtp.mail=sup-talk-bounces@rubyforge.org; dkim=neutral (body hash did not verify) header.i=@gmail.com Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id C7DA91858306; Fri, 15 Jan 2010 14:56:47 -0500 (EST) Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.24]) by rubyforge.org (Postfix) with ESMTP id 2147518582D0 for ; Fri, 15 Jan 2010 14:49:58 -0500 (EST) Received: by qw-out-2122.google.com with SMTP id 5so56072qwi.29 for ; Fri, 15 Jan 2010 11:49:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type; bh=e+nLc8FV2pcy0PCmQKDZWyNSBZyvowO3fn+HA7NAt94=; b=J1o+TXVyeAps4/F6bf2UmQxc8nq5oIugDTC9qTibXOVSvC9LpkJhTsw4GcgI1ZMc2w s4xhBOPIHgEEgGWzRmtuh9MKJ93SwuFGQk9s4feQ6g/7y+lg8OpAavRQx/wh66UCm607 G7jiZONIzComCn2KwC9CnJA3SlInBljb8sqJ4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=fB75rneb+NbXcIp/wOsWVeEFFlC+7mPNO2wro5KG+x4wJQO8M1bVOXtmlcSLze4yUh rGob5UH+yxtkitHeh5aTA3+3Gp/xlEbSxIzZskSE9DmedqAjbcxwcyzp0niU6oob3pbI 9pYhm3bEsiTjDKyIumTDBOWLchTBHfDQu9Z0Y= MIME-Version: 1.0 Received: by 10.229.22.133 with SMTP id n5mr2288659qcb.68.1263584978152; Fri, 15 Jan 2010 11:49:38 -0800 (PST) In-Reply-To: <1255620005-sup-7616@masanjin.net> References: <1255292940-sup-5558@masanjin.net> <1255611057-sup-1320@masanjin.net> <1255620005-sup-7616@masanjin.net> From: Dan Falcone Date: Fri, 15 Jan 2010 14:49:18 -0500 Message-ID: To: William Morgan Cc: sup-talk Subject: Re: [sup-talk] curses exception X-BeenThere: sup-talk@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: User & developer discussion of Sup List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============0263382527==" Sender: sup-talk-bounces@rubyforge.org Errors-To: sup-talk-bounces@rubyforge.org --===============0263382527== Content-Type: multipart/alternative; boundary=0016364c67c7c43202047d394dca --0016364c67c7c43202047d394dca Content-Type: text/plain; charset=ISO-8859-1 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 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 > _______________________________________________ > sup-talk mailing list > sup-talk@rubyforge.org > http://rubyforge.org/mailman/listinfo/sup-talk > --0016364c67c7c43202047d394dca Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi William,

Sorry I didn't get back to you sooner.=A0 I finally = got back around to playing with this again.=A0 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 wor= k and display color.=A0 I did have to edit them to add require 'rubygem= s' at the top.=A0

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

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

sup loads, but everything is in black and w= hite and a bit difficult to read.=A0 I also tried uncommenting that, then c= hanging Curses to Ncurses so it looks like this:

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

sup loads with that as well, and displays som= e color, but most of the screen is unreadable (I'm guessing it's di= splaying as white text on white background).=A0

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

Thanks!=
Dan


On Thu, Oct 15, 2009 at 11:27= AM, William Morgan <wmorgan-sup@masanjin.net> wrote:=
Reformatted excer= pts from Dan Falcone's message of 2009-10-15:
> Hmm... good question. =A0I regularly use emacs with colors enable= d, but
> I'm not sure if that uses curses. =A0I tried typespeed and that se= emed
> to work. =A0According 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?

=A0require 'rubygems'
=A0require 'ncurses'

=A0x =3D begin
=A0 =A0Ncurses::initscr();
=A0 =A0Ncurses::has_colors?()
=A0ensure
=A0 =A0Ncurses::endwin();
=A0end

=A0puts 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@rubyfo= rge.org
http://rubyforge.org/mailman/listinfo/sup-talk

--0016364c67c7c43202047d394dca-- --===============0263382527== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ sup-talk mailing list sup-talk@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-talk --===============0263382527==--