Hi,
I am facing a strange problem with putty as terminal emulator and using 
termguicolors and I hope someone here can give me a tip on how to debug 
this.

Putty recently learned to use 24bit colors which in Vim is enabled by 
setting the termguicolors option. However, when I set this, my cursor 
vanishes and I don't know how to debug this properly. This only happens, 
if I do not run tmux. Within tmux everything works as expected.

This works:
vim --clean --cmd 'set termguicolors' \
--cmd 'let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"' \
--cmd 'let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"'

However, as soon as the Normal highlighting group is not empty, the 
cursor block vanishes in non-empty lines (but will be drawn on empty 
lines (where no highlighting is done)):

vim --clean --cmd 'set termguicolors' \
--cmd 'let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"' \
--cmd 'let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"' \
--cmd 'hi Normal guibg=#262626' ~/.vim/vimrc

Empty lines are still drawn correctly. However, I usually set `:set t_ut=`
which makes the problem worse, because then no cursor is drawn anymore.

vim --clean --cmd 'set termguicolors' \
--cmd 'let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"' \
--cmd 'let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"' \
--cmd 'hi Normal guibg=#262626' \
--cmd ':set t_ut=' ~/.vim/vimrc

However, loading the default scheme makes it work again. But I believe 
this is, because default.vim does `:hi clear` which resets the Normal 
highlighting group and then the cursor will be drawn correctly. However 
this means, it basically breaks every colorscheme I have

Now, I suspected the keycodes t_vi (cursor invisible) and t_ve (cursor 
visible) to be the culprit, however setting those keycodes have no 
effect inside Vim. They are currently set (not by me but by default, 
reformated for copy-pasting):
,----
| let &t_vi="\e[?25l"
| let &t_ve="\e[?25h"
`----

And in a plain putty terminal I can make the cursor vanish using
`printf "\e[?25l"` (t_vi)  and appear again using `printf "\e[?25h"`

I tried making t_vi empty, because I saw in a script session a bunch of 
`t_vi` terminal keys appear, but the cursor still vanishes afterwards.

I then tried playing around with the t_SI, t_SR and t_EI keycodes as 
suggested by the help `:h termcap-cursor-shape` then I tried settting 
all those `request terminal feature` keycodes (t_u7, t_RB and t_RV) to 
empty, but I still see the problem and does not seem to help.

So I am now basically out of ideas.

Has anybody any clue, what could cause this only with the putty terminfo 
(but I also see this with xterm-256color TERM string) but not within 
tmux? Or how to further debug this? This is actually quite annoying.

Thanks,
Christian

-- 
-- 
You received this message from the "vim_dev" 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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui