John,
Ugh! What a mess this stuff is. The documentation is terse and ambiguous so I
just went back to the kernel source. Clearly you're using a different
configuration than mine in some regard since our results differ. My best guess
for you to get the final results you want is to add 15 to each of the 2nd and
3rd parameters in order to get black text. This should actually result in
dimmed text so it'll appear grey. To get dark black, change the first parameter
to 16 (from 120). So based on the results you report, something like:
setw -ga terminal-overrides
',*:Cc=\E[?16;%p1%s;255c:Cr=\E[?16;95;255c:civis=\E[?25l:cnorm=\E[?25h:cvvis=\E[?25h,'
And then add 15 to each of the values you were passing to vim.. so:
let &t_EI="\<esc>]12;31\007"
But i've lost confidence in my local results matching yours, so you'll just
have to play with it a bit. The main takeaway is that the 3rd parameter is
logically OR'd with the attribute bits and then parameter 2 is XOR'd. so in
the example above we're first forcing all attribute bits on (ie. with 255) and
then turning some of those bits off with whatever we set in parameter 2. The
8 attribute bits are broken into 2, 4-bit nibbles, one for the foreground and
the other for the background.
Good luck,
Sean
> Date: Sat, 28 Jul 2012 16:16:32 -0700
> From: listm...@b79.net
> To: tmux-users@lists.sourceforge.net
> CC: seanl...@sympatico.ca
> Subject: Re: Changing cursor color in a Linux framebuffer console
>
> Hi Sean,
>
> Thanks for the helpful explanations & examples, this gets me a lot
> closer. I've a few more questions...
>
> * Sean Estabrooks <seanl...@sympatico.ca> [120727 23:25]:
> > ...
> > Here is a setup that should work in Vim for you. ...
> >
> > tmux.conf entry :
> >
> > setw -ga terminal-overrides
> > ',*:Cc=\E[?120;%p1%s;240c:Cr=\E[?120;0;240c:civis=\E[?25l:cnorm=\E[?25h:cvvis=\E[?25h,'
> >
> > The linux terminfo entry here overrides the cursor color settings
> > for civis, cnorm, and cvvis and thus need to be redefined to allow
> > things to work. The other thing to note is the ;0 in the Cr entry
> > which will select white as the default cursor color.
>
> Using your suggested terminal-overrides entry, I swapped out that ;0
> with ;80 to get my desired color cursor:
>
> setw -ga terminal-overrides
> ',*:Cc=\E[?120;%p1%s;240c:Cr=\E[?120;80;240c:civis=\E[?25l:cnorm=\E[?25h:cvvis=\E[?25h,'
>
> > let &t_SI="\<esc>]12;96\007"
> >
> > let &t_EI="\<esc>]112\007"
>
> Wanting Vim's insert-mode cursor to be the default color and the
> normal-mode cursor color to be different, I set this in my ~/.vimrc:
>
> let &t_SI="\<esc>]112\007"
> let &t_EI="\<esc>]12;16\007"
>
> > The ";96" above will select a red cursor for insert mode.
>
> I found that ;96 sets the cursor to light blue, ;16 sets it to yellow
> and ;80 sets it to light green. I've read though the console_codes(4)
> manpage, the /usr/src/linux/Documentation/VGA-softcursor.txt file, and
> this page which seems explain VGA-softcursor.txt a bit:
>
> Cursor Appearance in the Linux Console
> http://linuxgazette.net/137/anonymous.html
>
> ...but it's still all rather confusing.
>
> > ... the codes you'll have to choose from for each of
> > the 8 available colors:
> >
> > Black = 224
> > Blue = 192
> > Green = 160
> > Cyan = 128
> > Red = 96
> > Magenta = 64
> > Orange = 32
> > White = 0
>
> I get different colors for these (hardware dependent behaviour?), but
> trying the following values I can see all the 16 colors my framebuffer
> console is capable of:
>
> 0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, 240
>
> I set the default cursor foreground color to green with ;80 and yellow
> with ;16 ...so far so good. But now it's the cursor background color
> I'm having trouble with. These values set the background color to
> white and I'd like it to be black, as a yellow or green cursor over a
> black character provides better contrast.
>
> I *think* what I need to do is change the ;0 and ;240 values in the
> terminal-overrides string you suggested in concert with that ;96 value
> in my vimrc. These all seem interrelated, and I haven't been able to
> sort out the right combination that'll provide the desired cursor
> foreground colors along with a black background in all cases.
>
> Any further clues much appreciated (ie, would I change both values in
> the terminal-overrides entry currently shown as ;240 ?).
>
> Regards,
>
> John
>
> --
> John Magolske
> http://B79.net/contact
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users