This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: mintty and Control-` , Control-~


Am 20.04.2013 22:14, schrieb Andy Koppe:
On 21 March 2013 15:53, Ryan Johnson wrote:
On 21/03/2013 11:30 AM, Igor Bukanov wrote:
It seems that mintty in Cygwin under Windows-7 does not pass C-`
(Control-backtick, in US keyboard this is the key above the tab) nor
C-~ (or Control-Shift-backtick) to terminal applications. Any reason
for that?
A quick test [3] in shortcut override mode [1] suggests that mintty never
receives that key combination in the first place.
Nah, it does receive it alright. Well, for me anyay. Shortcut override
mode only affects combinations that mintty normally uses for its own
purposes, for example Shift+Insert for paste.

However, trying the same test in xterm, I get \000 and \036 for C-` and C-~,
respectively. Neither of those seems to be correct [2] (\000 is ^@ and \036
is ^^)
Indeed. Backtick and tilde don't directly correspond to control
characters, so mintty doesn't send anything for them.

What you can do is enable the so-called modifyOtherKeys mode (which
comes from xterm), in which case mintty sends the keycodes specified
on the following page for combinations that don't have a standard
keycode:

http://www.leonerd.org.uk/hacks/fixterms/

The following will enable modifyOtherKeys mode level 1:

$ echo -ne '\e[>4;1m'

There's also a level 2, in which those special keycodes are sent even
for standard combinations such as Ctrl+letter.

$ echo -ne '\e[>4;2m'

but it's still odd that xterm can receive key codes that mintty misses.
I guess I decided not to support those keycodes for Ctrl+` and Ctrl+~
because they're not intuitive and they just send the same as Ctrl+@
and Ctrl+^ (and also Ctrl+Space and Ctrl+Enter) anyway.

In order to make them useful without enabling modifyOtherKeys mode,
how about if Ctrl combinations with backtick (ASCII 0x60), opening and
closing brace (0x7B and 0x7D), pipe (0x7C), and tilde (0x7E) were
mapped to C1 control characters (in the U+0080 to U+009E range).
I don't think it's useful to support C1 control characters because virtually nobody will ever want to input them via keyboard; even more if only a random subset of C1 can be supported this is only confusing.

Incidentally, on US and UK keyboards (and others) that's what already
happens for the braces and pipe symbol, because for example the pipe
symbol is typed with Shift+\, and mintty maps Ctrl+Shift+\ to U+009C
as explained at http://code.google.com/p/mintty/wiki/Keycodes#Ctrl.
I would drop those, too.

I hope I've suitably confused matters now.
Yes :)
Thomas

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]