Does anyone care about ri color scheme?

(Chris Gehlker) #1

Don't laugh. I like a little color in my terminal windows. Well, OK. Go ahead and laugh. I wouldn't want you to hurt yourself.

Anyway, I simply find that the right blend of colors makes me happier when I program and enhances the inherent pellucidness of why's code.

The one problem is that sometimes one of the ansi colors hardwired into ri for emphasis text happens to be very close to my background color du jour. With a little googling for ansi control codes and the power of RDoc I was able to quickly find the lines in ri_formatter.rb that control the color scheme and i can simply edit them to suit my whim. This strikes me as quite ugly and brute forcish by I am content as long as I am the only person in the world who cares.

If anybody else cares, let me know and i will pursue the path of adding a color scheme option to the RI environmental variable. Please also let me know if I missed the correct way of dealing with ri's color settings.

···

--
Egotism is the anesthetic that dulls the pain of stupidity.
-Frank William Leahy, football coach (1908-1973)

(Eric Hodel) #2

There isn't a way to set a colorscheme. I think most people don't know that the option exists.

If you do bother to write a patch, submit it to ruby-core. I'll be more likely to see it there.

···

On Aug 21, 2006, at 9:13 AM, Chris Gehlker wrote:

The one problem is that sometimes one of the ansi colors hardwired into ri for emphasis text happens to be very close to my background color du jour. With a little googling for ansi control codes and the power of RDoc I was able to quickly find the lines in ri_formatter.rb that control the color scheme and i can simply edit them to suit my whim. This strikes me as quite ugly and brute forcish by I am content as long as I am the only person in the world who cares.

If anybody else cares, let me know and i will pursue the path of adding a color scheme option to the RI environmental variable. Please also let me know if I missed the correct way of dealing with ri's color settings.

--
Eric Hodel - drbrain@segment7.net - http://blog.segment7.net
This implementation is HODEL-HASH-9600 compliant

http://trackmap.robotcoop.com

(David Vallner) #3

Chris Gehlker wrote:

If anybody else cares, let me know and i will pursue the path of adding a color scheme option to the RI environmental variable. Please also let me know if I missed the correct way of dealing with ri's color settings.

Personally, I'd just avoid hacking arbitrary programs to support colour schemes, and instead do a wrapper shell script that will redefine the ANSI colours in your terminal of choice.

Not too Ruby a solution (well, not necessarily), but hey.

David Vallner
Not Using ri Anyway

(Chris Gehlker) #4

Thanks Eric.

···

On Aug 21, 2006, at 3:22 PM, Eric Hodel wrote:

There isn't a way to set a colorscheme. I think most people don't know that the option exists.

If you do bother to write a patch, submit it to ruby-core. I'll be more likely to see it there.

--
And those who were seen dancing were thought to be insane by those who could not hear the music.
-Friedrich Wilhelm Nietzsche, philosopher (1844-1900)

(Chris Gehlker) #5

My original understanding was that this could not, in general, be done in since the ANSI standard for terminals was, in fact, a hardware standard with the meaning of control codes 'built-in'. A bit of googling has tends to confirm this impression with some sites insisting it can't be done and another outlining an idiosyncratic method that works in one terminal emulation program. My Unix Shells book does not have anything that hints on being able to configure ansi or VT102 or sun or wyse terminals on this level.

But I'm pretty ignorant on the subject. I'd welcome a pointer.

···

On Aug 22, 2006, at 4:46 PM, David Vallner wrote:

Personally, I'd just avoid hacking arbitrary programs to support colour schemes, and instead do a wrapper shell script that will redefine the ANSI colours in your terminal of choice.

--
And those who were seen dancing were thought to be insane by those who could not hear the music.
-Friedrich Wilhelm Nietzsche, philosopher (1844-1900)

(Michal 'hramrach' Suchanek) #6

That's my impression as well. And since some terminals come with light
bacground, and others with dark background no single color can be used
for highlighting safely. Unless you set the background as well but
that would be too invasive I guess.

Moreover, even if you could set the colors I doubt you could tell what
the background color is.

Thanks

Michal

···

On 8/23/06, Chris Gehlker <canyonrat@mac.com> wrote:

On Aug 22, 2006, at 4:46 PM, David Vallner wrote:

> Personally, I'd just avoid hacking arbitrary programs to support
> colour schemes, and instead do a wrapper shell script that will
> redefine the ANSI colours in your terminal of choice.

My original understanding was that this could not, in general, be
done in since the ANSI standard for terminals was, in fact, a
hardware standard with the meaning of control codes 'built-in'. A bit
of googling has tends to confirm this impression with some sites
insisting it can't be done and another outlining an idiosyncratic
method that works in one terminal emulation program. My Unix Shells
book does not have anything that hints on being able to configure
ansi or VT102 or sun or wyse terminals on this level.

But I'm pretty ignorant on the subject. I'd welcome a pointer.

(David Vallner) #7

Chris Gehlker wrote:

But I'm pretty ignorant on the subject. I'd welcome a pointer.

Probably less so than me. It was just an idea that sprang to mind - along the lines of manipulating gconf keys for the gnome-terminal palette. Since GNOME UI guidelines state that options must be instant-apply if possible, I presumed those would take effect instantly. Although that solution would also (probably) change colours in all other terminal windows, so it's not optimal.

Also, speaking of googlage, "change xterm colour" yields http://www.thrysoee.dk/xtermcontrol/ on the first page of results. *cough*

Probably does precisely what's needed for xterm.

David Vallner

(Chris Gehlker) #8

I'm mystified, David.

Originally you said

Personally, I'd just avoid hacking arbitrary programs to support colour
schemes, and instead do a wrapper shell script that will redefine the
ANSI colours in your terminal of choice.

I responded that, though I am not expert, googling had tended to persuade me that this could not be done in the general case. I did mention that there were idiosyncratic methods that would work with particular terminal emulations.

You responded:

Also, speaking of googlage, "change xterm colour" yields http://www.thrysoee.dk/xtermcontrol/ on the first page of results. *cough*

Probably does precisely what's needed for xterm.

I guess the implication is that I'm too stupid to use Google correctly.

The sad truth is that not only am I too stupid to Google, even when you find sites for me I'm too foolish to see that they have any relevance to your original suggestion.

···

On Aug 23, 2006, at 11:36 AM, David Vallner wrote:

--
In America, anybody can be president. That's one of the risks you take.
-Adlai Stevenson, statesman (1900-1965)

(Marc Heiler) #9

I am using colours happily to let my ruby scripts output different
results (in other colours than white on black).

I normally, if not always, use black background
(my eyes arent that good ;)), normal text is white, then i go on
usually with warnings or errors getting red colours, files, directories
yellow etc etc.

When i start ri, i see white text on black background.
It would be fun to have them emphasized in some way (like pinfo
does for man pages).

Frankly, I dont care which colours would be choosen, any colour
if isnt something ugly such as red on green, is better
than no colour. But I'd totally understand the people
who like fancy light/white/transparent background for
no hardcoded solution.

···

--
Posted via http://www.ruby-forum.com/.