Matthew Woehlke wrote:
Matthew Woehlke wrote:
Mikolaj Machowski wrote:
Is it possible to recognize if window or tab of Konsole lost focus
through termcap/terminfo sequence?
Or is it at least possible with dcop or any other way?
I am investigating ways to support Vim FocusGain/FocusLost autoevents.
[snip long answer]
[...and short answer, too]
Robert Knight says we should be able to add escape sequences to Konsole
to support this. I might be able to help with the patching (although it
is KDE4 that will really get the fix, anything for KDE3 does not seem
likely to be accepted, so you would be patching your own local version),
but someone Vim-side needs to tell us what Konsole needs to provide...
Does Vim already support notifications for some terminal emulators? If
so, how do we go about adding Konsole to that list?
Sure. At the very least, it reacts to the notifications that a key has been
pressed, or the mouse moved or clicked ;-) or, more seriously, to FocusGained
and FocusLost events for "the GUI and a few console versions where this can be
detected". I suppose any notification mechanism would be OK, as long as Vim
can be made to listen to it and trigger its (already defined) FocusGained and
FocusLost events (q.v.). Do the termcap/terminfo libraries provide for
representation of focus-related event signals? I don't know, but IMHO it would
be easiest if they did; however, even if they don't, I suppose an appropriate
event handler could be programmed into Vim, provided that there existed _any_
method to communicate those events unambiguously to a running program. If
there are several incompatible ways to do it depending on OS and terminal,
then I suppose it could be implemented via a configure argument and/or a
configure library search, the way mouse handlers are already included or
excluded at compile (or more precisely configure) time: see
vim --version | grep mouse
Best regards,
Tony.