Subject: [sup-talk] Strange random changing of default colors

From: [email-masked] (Mark Alexander)
Date: Wed, 20 May 2009 07:55:28 -0700

For while now I've been running off of the next branch,
and I've been noticing strange and hard-to-reproduce
problems with sup changing the default colors.  When
I start it, things are fine for a few minutes, and the default
colors (for things like the unused portion of the display
or quoted text) are fine.  Then after a few minutes,
the default colors will get changed to yellow-on-black,
or black-on-red, or some other strange thing.  I haven't
been able to track down exactly what causes this.
Sometimes it happens when going through my inbox;
sometimes from doing a '/' to search for a string.

The only thing I can say is that the new default colors
seem to have been picked from some line that was
being displayed by sup.  For example, a few times
when an "unreceived message" line was being displayed
in a thread, and I moved the highlight over that line,
the default colors got changed to the colors of that
line (black on red in this case).

I've seen this on both Fedora Core 4 with xterm,
and OpenSUSE 10.2 with konsole.  So it's possible
it's a problem with older versions of ncurses.
I'll try this on Ubuntu 8.10 at some point soon.

Has anybody else noticed this?

---

From: [email-masked] (Mark Alexander)
Date: Wed, 20 May 2009 11:04:08 -0700

On Wed, May 20, 2009 at 10:26 AM, Marc Hartstein
<marc.hartstein at alum.vassar.edu> wrote:
> Excerpts from Mark Alexander's message of Wed May 20 10:55:28 -0400 2009:
> I'm running Gentoo here, and keep my system fairly up-to-date.  ncurses
> is 5.6-r2, and I run under screen under rxvt-unicode.

I forgot to mention I'm running screen too.  I'll try eliminating screen
to see if that changes anything.

---

From: [email-masked] (William Morgan)
Date: Wed, 20 May 2009 11:52:04 -0700

Reformatted excerpts from Mark Alexander's message of 2009-05-20:
> For while now I've been running off of the next branch, and I've been
> noticing strange and hard-to-reproduce problems with sup changing the
> default colors.

I've fixed this in master and next. The problem was that Curses limits
you to a set number of color pairs, and I had thought that limit was 16
(the Ruby bindings don't seem to expose it), and so if you used Sup for
long enough you would eventually run out of colors and it would
helpfully replace old color definitions with new ones for you. :)

But rumors suggest that the limit is more like 64, except in archaic
cases, so I've hard-coded that instead of 16, and experimentally it
seems fine to me (even running through screen).

Let me know if you experience more color weirdness, especially on
archaic systems like Mac OS and Windows.
-- 
William <wmorgan-sup at masanjin.net>

---

From: [email-masked] (Mark Alexander)
Date: Thu, 21 May 2009 09:33:12 -0700

Excerpts from William Morgan's message of Wed May 20 11:52:04 -0700 2009:
> I've fixed this in master and next.

Thanks!  It's looking good so far, after a day of use.