into your vimrc. (In case they get wrapped in this post: these are five lines.) If you use more than one profile in gnome-terminal, you might have to tweak this a little.
I have a working solution for urxvt (using a |-cursor shape, but you lose the underline cursor for a | cursor, or you can use a _ cursor) if someone want it send me a mail and I put it all together tomorrow.
-- «Dans la vie, rien n'est à craindre, tout est à comprendre» Marie Sklodowska Curie.
On Sun, 2009-03-29 at 16:41 -0300, Kazuo Teramoto wrote: > I have a working solution for urxvt (using a |-cursor shape, but you > lose the underline cursor for a | cursor, or you can use a _ cursor) > if someone want it send me a mail and I put it all together tomorrow.
> into your vimrc. (In case they get wrapped in this post: these are five > lines.) If you use more than one profile in gnome-terminal, you might > have to tweak this a little.
Unless I'm misunderstanding something, this would not only work improperly when combined with tools like screen and dvtm, but also - when you have multiple terminals open it would change the cursor shape in all of them!
> as many others, i was interested in changing the cursor shape. For KDE4 > and GNOME i found these solutions:
> In KDE4 : Put
> In GNOME 2.26 : Put
As we know KDE and GNOME are two most popular Linux desktop environments and the terminal emulator included is there.
However, I use different computers, they have KDE or GNOME, and I often need to use vim in remote ssh sessions, such as open the GNOME terminal locally and ssh to a remote computer which has KDE.
Any one knows how to check in .vimrc whether I'm in KDE4 Konsole or in GNOME terminal in a remote ssh session?
> On Sat, Mar 28, 2009 at 8:02 AM, André Scholz wrote: >> Hello, >> In KDE4 : Put > That won't play nicely with gnu screen, or with dvtm, or any of the > other terminal multiplexers out there...
That's not a big problem for gnu screen, since we've got &term=='screen' in screen and &term=='xterm' in konsole. I can enable the sequences only for &term=='xterm'.
The problem is: too many terminal emulators claims to be &term=='xterm' while they are not identical. It would be much better if there's a way to know the exact terminal emulator program name in .vimrc.
> Matt Wozniski 写道: >> On Sat, Mar 28, 2009 at 8:02 AM, André Scholz wrote: >>> Hello, >>> In KDE4 : Put >> That won't play nicely with gnu screen, or with dvtm, or any of the >> other terminal multiplexers out there...
> That's not a big problem for gnu screen, since we've got &term=='screen' > in screen and &term=='xterm' in konsole. I can enable the sequences only > for &term=='xterm'.
Well, as I said later, it also might not play nicely with multiple tabs, or even multiple terminals (at least, the suggest gnome-terminal version wouldn't, not sure about the suggested konsole version).
> The problem is: too many terminal emulators claims to be &term=='xterm' > while they are not identical. It would be much better if there's a way > to know the exact terminal emulator program name in .vimrc.
Set up the terminal emulator to send something more correct; any sane terminal emulator should let you. It's perfectly common to set up xterm to set TERM=xterm-256color, to set up konsole to set TERM=konsole-256color, to set up screen to set TERM=screen-256color, etc... Unfortunately, to the best of my knowledge gnome-terminal fails this sanity test - I know of no way to get it to set $TERM to the correct value (gnome-256color) without patching the source and recompiling.
> Am 07.04.2009 13:49, pansz schrieb: >> [...] >> Any one knows how to check in .vimrc whether I'm in KDE4 Konsole or in >> GNOME terminal in a remote ssh session? >> [...]
> I don't know if it works with SSH put you can query the COLORTERM > environment variable:
> :echo $COLORTERM
> Gnome Terminal sets it to gnome-terminal. I don't know what Konsole does.
> HTH, > Dennis Benzinger
On my system it doesn't set it. Anyway, I suppose that a value of "gnome-terminal" would be rather characteristic. Remains to be seen how to tell xterm apart from konsole. From v:termresponse maybe? Let's see what I get:
(where the initial ^[ is an "escape" character) so the results are indeed different, but I don't think the criterion can be ported to an unknown system (I mean, you need to make the experiment separately for each installation -- and it may change if you upgrade one of these packages).
Best regards, Tony. -- If God is perfect, why did He create discontinuous functions?
> On my system it doesn't set it. Anyway, I suppose that a value of > "gnome-terminal" would be rather characteristic. Remains to be seen how > to tell xterm apart from konsole. From v:termresponse maybe? Let's see > what I get:
> (where the initial ^[ is an "escape" character) so the results are > indeed different, but I don't think the criterion can be ported to an > unknown system
It seems work, but we may need to do some regexp matching... Let's see what I get:
So the number may not be exactly the same, while we should tell differences between konsole and gnome-terminal anyway. While the konsole in KDE3 and KDE4 returns the same value, which is somewhat undesirable.
> > On my system it doesn't set it. Anyway, I suppose that a value of
> > "gnome-terminal" would be rather characteristic. Remains to be seen how
> > to tellxtermapart from konsole. From v:termresponse maybe? Let's see
> > what I get:
> > (where the initial ^[ is an "escape" character) so the results are
> > indeed different, but I don't think the criterion can be ported to an
> > unknown system
> It seems work, but we may need to do some regexp matching...
> Let's see what I get:
The 115 was copied from one of xterm's strings.
gnome terminal copied it around the same time, but
at a later point added a digit. Since then, the
trail's grown indistinct (gnome developers as a
matter of practice, do not document their changes
very well ;-)
> So the number may not be exactly the same, while we should tell
> differences between konsole and gnome-terminal anyway. While the konsole
> in KDE3 and KDE4 returns the same value, which is somewhat undesirable.
The "1" in gnome-terminal's response would claim that
it emulates a vt220. It only implements enough of
a subset to be a nuisance when one tries to use it
as a vt220 (on VMS for instance). One of gnome-terminal's
bug reports pointed that out, and the advice given there
was to change the response to fix the bug. (The developer
failed to comprehend the advice - it's apparent in his
response ;-).