Thanks, I'll try those sequences. For the Linux non-X11 console (where
$TERM is "linux") it's probably hopeless indeed, and I'll add an "if
!has("gui_running") around the whole stuff because in gvim it already
works. It would probably still work without it, because starting the
GUI sets 'term' to "builtin_gui" and changes the whole termcap, but I
don't need to add unnecessary processing for the short time between
sourcing the vimrc and starting the GUI.
If the codes for "real xterm" don't work in konsole, AFAIK I'll have
to place the whole stuff at the TermResponse event (which is fired in
both), because in konsole I have a $TERM starting with xterm but a
different v:termresponse (ESC [>0;115;0c in konsole but ESC
[>41;330;0c in xterm, IOW konsole tries to emulate xterm in vt100 but
I don't know what "terminal type 41" means in a real xterm). I notice
that in both cases, and contrary to what is said at ":help
v:termresponse", the first character after ESC [ is a greater-than
sign which is none of a digit, semicolon or period.
To restore the block cursor at Vim exit I suppose it is enough to use
(not yet tested)
au VimLeave * exe "normal \<C-\\>\<C-N>"
to put Vim in Normal mode; however "leaving Vim normally" is by means
of a :qa or :xa command, which is started from Normal mode and leaves
Vim in it so that autocommand would only matter for "abnormal exits".
Best regards,
Tony.