On Nov 12, 2007 4:29 AM, Gautam Iyer <[EMAIL PROTECTED]> wrote:
>
> On Mon, Nov 12, 2007 at 02:56:24AM -0500, Matthew Wozniski wrote:
>
> > > Do all the terminals supporting 88 and 256 colors really use the same
> > > color values?
> >
> > Well...  As far as I can tell, they seem to _default_ to the same
> > values.  In the interest of researching this properly, I've
> > source-dived a few to be sure.
> >
> > GNOME Terminal:       same palette as xterm-256color (vte.c:2399)
> > PuTTY (pterm):        same palette as xterm-256color (gtkwin.c:1432)
> > Mrxvt:                same palette as xterm-256color (init.c:110)
> >
> > Rxvt-unicode: 88 colour palette (init.C:74).

> Btw -- rxvt uses a different palette. And if I remember correctly,
> Konsole uses the same palette as rxvt.

Hm.... it seems like you're right, the colors in Konsole are ever so
slightly off...  It looks as though they're stepping evenly...
xterm's steps are 00, 5F, 87, AF, D7, FF ; it favors the lighter colors.
konsole's are 00, 33, 66, 99, CC, FF ; it favors being even...

(I found it at TECommon.h:149 after searching harder)

So, I would certainly welcome some advice on how querying
can be done reasonably...

Gnome-terminal and Konsole, at least, do not seem to be able
to report back their colors...  So, I guess one (pseudocode)
approach is...

if $TERM =~ 'screen'
  prefix = "\eP"
  suffix = "\e\\"
endif

resp = send_query(prefix + "\e]4;17;?\007" + suffix)

if resp != ""
  palette = query_active_palette() # Repeatedly calls send_query
else
  # No answer: assume default based on &t_Co
  if &t_Co == 88
    palette = default_urxvt
  else
    if $KONSOLE_DCOP_SESSION == ""
      palette = default_xterm_gnome_terminal_putty
    else
      palette = default_konsole_rxvt
    endif
  endif
endif

Any thoughts?  At the very least, this fails where a user launches
gnome-terminal from konsole, since KONSOLE_DCOP_SESSION
would have been exported... Is there a better way to tell them
apart?  Why can't they use $TERM right... :-/

> I went through some pain and suffering to get a color scheme (xterm16)
> to display the same colors in the GUI, and the various terminal
> emulators around. It WorksForMe (TM), but every few months or so someone
> reports a situation where the colors are slightly  different than they
> should be...
>
> If specifying colors via #rrggbb gets implemented, it would certainly
> make the code in xterm16.vim a lot cleaner...

Here's hoping.  :)

~Matt

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui