Monday, February 27, 2012

Re: Vim Cursor Color Terminal Bug

Hi Doppp!

On Do, 23 Feb 2012, Doppp wrote:

> I encountered this pretty strange bug when I was trying to fix my Vim
> cursor color.
>
> I am using Terminator and I found out that the cursor colors for my
> color scheme were not working. I did a Google search and was brought
> to this site where I used this snippet of code:
>
> if &term =~ "xterm\\|rxvt"
> " use an orange cursor in insert mode
> let &t_SI = "\<Esc>]12;orange\x7"
> " use a red cursor otherwise
> let &t_EI = "\<Esc>]12;red\x7"
> silent !echo -ne "\033]12;red\007"
> " reset cursor when vim exits
> autocmd VimLeave * silent !echo -ne "\033]112\007"
> " use \003]12;gray\007 for gnome-terminal
> endif
>
> The cursor colors changed and things worked fine. However, I
> encountered a weird bug after including this code. Say I opened a new
> terminal, entered Vim and then just quit. My shell prompt will
> suddenly go to the bottom of the terminal and there would be a huge
> chunk of whitespace/newlines between the top of the terminal (where
> the previous prompt was) and the new prompt at the bottom of the
> terminal. I commented out this line:
>
> silent !echo -ne "\033]12;red\007"
>
> And the bug went away but then the cursor color doesn't change now.
> I'm not too familiar with vimscript or shell script so it would be
> great if anyone could help me out in fixing this little bug.

I can't reproduce this with terminator 0.95

It does sound however like a problem with your terminfo/termcap
database. So may be you want to see, if there is a newer ncurses library
available on your system.

I am not even sure, your $TERM should point to xterm, when using
terminator. You can however try to set you 'term' option to ansi and see
if setting the terminal optiones (t_SI and t_EI) and also the silent
echo call still work.

You can also play around setting the $TERM variable to one of
xterm-color
xterm-256color
xterm-debian
and see, if it still happens. This should make sure, the terminal
understands at least 256 colors and also other advanced features.

regards,
Christian
--
Gebrauche nie ein hartes Wort, wo ein glimpfliches seine Dienste tut.
-- Johann Peter Hebel

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: