On Tue, 17 Apr 2012, Paul LeoNerd Evans wrote:
On Tue, Apr 17, 2012 at 12:59:53PM -0700, Ben Fritz wrote:
We've had this discussion many times. I think everybody agrees it's a
feature that's wanted. Yet nobody, including LeoNerd, has come
forward with any code whatsoever, working or not. If it was actually
a simple "copypaste some .c code and it will work" sort of problem,
then it would be done by now.
OK.
1) I have never been anywhere near vim's source code.
However, if someone here could tell me:
a) what to type to obtain working checkout
b) which file/line ultimately contains the code to insert a new
keypress into the pending queue when read from the terminal
c) how to use CSI_SPECIAL to insert arbitrary modifiers, such as
Ctrl-Shift-I.
Then I'll have a jolly good go at making this work.
Specifically, I'd love to see an example of some silly code somewhere
that just inserts something silly, like Ctrl-Shift-I once.
If it were as simple as pointing out where the central "Insert keystroke
into processing queue" functionality lives, my guess is that it'd have
been done already. (And we could move on to the "Yay! Finally! So, what
tweaks are left?" phase.)
I don't think Ben Fritz's intent was to say that you (LeoNerd) need to
be the one to implement it. Just that anyone complaining needs to
understand that it's not a trivial undertaking, and that no developer
with a high degree of Vim-familiarity has stepped up to do it yet. (I'm
getting really close, personally, but I'm probably a third-tier Vim
dev.)
The fact that it's not backwards compatible is also (unfortunately)
problematic (Cf. Tony Mechelynck's questions about whether <C-]> and
<Esc> will be identical in the future).
But that's a political question. (Personally, I tend toward "If
people/scripts rely on the broken behavior, too bad". But, if I were
the "benevolent dictator", there wouldn't be a 'compatible' setting.)
2) Take a look anywhere near libtermkey:
http://www.leonerd.org.uk/code/libtermkey/
Specifically the little demo at
http://www.leonerd.org.uk/code/libtermkey/overview.html
Observe that it has the ability to represent all of this lot just
fine.
Granted /and I accept/ that you will need a specially-configured
terminal to get "non-traditional" keypresses out of it like Ctrl-I or
Ctrl-Shift-[letter], but even without that, it will handle Escape vs.
Alt+letter vs. UTF-8 absolutely fine on any standard terminal. It's
this part most of all I want to add to vim, so everyone will benefit.
The fact I'll be able to map Ctrl-I and Ctrl-Shift-A and so on will
just a small added bonus.
How portable is libtermkey? I generally dislike the Vim party line on
backwards compatibility. But, being cross-platform is a good thing.
Also, last time I checked libtermkey out, there were quirks even with
the XTerm implementation of the "extended" sequences. E.g.:
On a U.S. QWERTY keyboard, where the row with numerals is:
unshifted: `1234567890
shifted: ~!@#$%^&*()
With <Shift> depressed, using the libtermkey demo, I get:
<S-~> ! <S-@> # $ % <S-^> & * ( )
That is: Depending on how you look at it: 8 of 11 characters don't
detect that <Shift> is depressed; or 3 of the characters that can't be
typed without <Shift> get an extra <Shift> modifier.
And even for the <Tab> <C-i> <C-I>, case:
<Tab> <C-i> <C-S-I>
(Why the capital 'I' in addition to 'S-'? Or is it just a libtermkey
demo convention?)
The Vim-relevant point to all this being: it seems like more
standardization is necessary (not sure from XTerm or libtermkey).
Otherwise we're going to trade "I can't map <C-i>" problems for "I can't
map <~> or <^> or <I>".
--
Best,
Ben H
--
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