public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* mintty and modifier keys
@ 2012-07-19 15:38 Ryan Johnson
  2012-07-19 16:56 ` Aaron Schneider
  2012-07-19 19:06 ` Andy Koppe
  0 siblings, 2 replies; 5+ messages in thread
From: Ryan Johnson @ 2012-07-19 15:38 UTC (permalink / raw)
  To: cygwin

Hi all (mostly Andy),

I notice that mintty 1.1 handles certain key combinations differently 
than xterm:

ctrl+enter produces 0x1e (RS) vs. CR in xterm
alt+enter produces ESC CR vs. nothing at all in xterm

ctrl+shift+<letter> emits the unicode C2 control codepoints (0xc281 
through 0xc29a); xterm emits the C0 control value as if shift were 
unpressed.

So, two questions:
1. Is there a particular reason for this behavior? Perhaps rxvt or some 
other non-xterm terminal emulator does it?
2. Is there documentation somewhere of what convention mintty follows 
for the various special cases?

(these questions are partly triggered by frustration at shift+enter not 
working, which lead to me finding a reasonably sane proposal to fix 
these kinds of terminal woes [1]; I was surprised to find that mintty 
can already distinguish some key presses that xterm can't)

[1] www.leonerd.org.uk/hacks/fixterms/

Thanks,
Ryan


--
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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: mintty and modifier keys
  2012-07-19 15:38 mintty and modifier keys Ryan Johnson
@ 2012-07-19 16:56 ` Aaron Schneider
  2012-07-19 17:20   ` Christopher Faylor
  2012-07-19 19:06 ` Andy Koppe
  1 sibling, 1 reply; 5+ messages in thread
From: Aaron Schneider @ 2012-07-19 16:56 UTC (permalink / raw)
  To: cygwin

On 19/07/2012 17:37, Ryan Johnson wrote:
> Hi all (mostly Andy),
>
> I notice that mintty 1.1 handles certain key combinations differently
> than xterm:
>
> Thanks,
> Ryan
>

Could you report it to the mintty developer?
http://code.google.com/p/mintty/

--
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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: mintty and modifier keys
  2012-07-19 16:56 ` Aaron Schneider
@ 2012-07-19 17:20   ` Christopher Faylor
  0 siblings, 0 replies; 5+ messages in thread
From: Christopher Faylor @ 2012-07-19 17:20 UTC (permalink / raw)
  To: cygwin

On Thu, Jul 19, 2012 at 06:56:39PM +0200, Aaron Schneider wrote:
>On 19/07/2012 17:37, Ryan Johnson wrote:
>> Hi all (mostly Andy),
>>
>> I notice that mintty 1.1 handles certain key combinations differently
>> than xterm:
>
>Could you report it to the mintty developer?
>http://code.google.com/p/mintty/

I'm pretty sure the developer reads this mailing list.

cgf

--
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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: mintty and modifier keys
  2012-07-19 15:38 mintty and modifier keys Ryan Johnson
  2012-07-19 16:56 ` Aaron Schneider
@ 2012-07-19 19:06 ` Andy Koppe
  2012-07-19 20:32   ` Ryan Johnson
  1 sibling, 1 reply; 5+ messages in thread
From: Andy Koppe @ 2012-07-19 19:06 UTC (permalink / raw)
  To: cygwin

On 19 July 2012 16:37, Ryan Johnson wrote:
> Hi all (mostly Andy),
>
> I notice that mintty 1.1 handles certain key combinations differently than
> xterm:
>
> ctrl+enter produces 0x1e (RS) vs. CR in xterm
> alt+enter produces ESC CR vs. nothing at all in xterm
>
> ctrl+shift+<letter> emits the unicode C2 control codepoints (0xc281 through
> 0xc29a); xterm emits the C0 control value as if shift were unpressed.
>
> So, two questions:
> 1. Is there a particular reason for this behavior?

Yes, I tried to make as many key combinations as reasonably possible
available to applications without having to enable a special mode. I
chose ^^ (0x1e) for Ctrl+Enter rather than a multi-character code so
as to be able to use it in stty settings. Similarly, Ctrl+Backspace
sends ^_ (0x1f).

> Perhaps rxvt or some other non-xterm terminal emulator does it?

Nope, they're mintty-specific.

> 2. Is there documentation somewhere of what convention mintty follows for
> the various special cases?

Yep:

http://code.google.com/p/mintty/wiki/Keycodes#Ctrl
http://code.google.com/p/mintty/wiki/Keycodes#Special_keys

See also this on how those keycodes could be put to use in the stty settings:

http://code.google.com/p/mintty/wiki/Tips#Terminal_line_settings

> (these questions are partly triggered by frustration at shift+enter not
> working, which lead to me finding a reasonably sane proposal to fix these
> kinds of terminal woes [1]; I was surprised to find that mintty can already
> distinguish some key presses that xterm can't)
>
> [1] www.leonerd.org.uk/hacks/fixterms/

Hmm, that basically describes xterm's "modifyOtherKeys" mode, which
mintty supports too. This can be enabled with the sequence "\e[>4;1m".
(That's for level 1. There's also level 2, enabled with "\e[>4;2m",
where the suggested CSI u keycodes are sent even for Ctrl+letter
combinations.)

Andy

--
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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: mintty and modifier keys
  2012-07-19 19:06 ` Andy Koppe
@ 2012-07-19 20:32   ` Ryan Johnson
  0 siblings, 0 replies; 5+ messages in thread
From: Ryan Johnson @ 2012-07-19 20:32 UTC (permalink / raw)
  To: cygwin

On 19/07/2012 3:06 PM, Andy Koppe wrote:
> On 19 July 2012 16:37, Ryan Johnson wrote:
>> Hi all (mostly Andy),
>>
>> I notice that mintty 1.1 handles certain key combinations differently than
>> xterm:
>>
>> ctrl+enter produces 0x1e (RS) vs. CR in xterm
>> alt+enter produces ESC CR vs. nothing at all in xterm
>>
>> ctrl+shift+<letter> emits the unicode C2 control codepoints (0xc281 through
>> 0xc29a); xterm emits the C0 control value as if shift were unpressed.
>>
>> So, two questions:
>> 1. Is there a particular reason for this behavior?
> Yes, I tried to make as many key combinations as reasonably possible
> available to applications without having to enable a special mode. I
> chose ^^ (0x1e) for Ctrl+Enter rather than a multi-character code so
> as to be able to use it in stty settings. Similarly, Ctrl+Backspace
> sends ^_ (0x1f).
... and then those get encoded with utf-8 as appropriate. Got it.

>> Perhaps rxvt or some other non-xterm terminal emulator does it?
> Nope, they're mintty-specific.
Fair enough. They seem like reasonable choices, especially compared with 
xterm (where some key combos send nothing at all!)

>
>> 2. Is there documentation somewhere of what convention mintty follows for
>> the various special cases?
> Yep:
>
> http://code.google.com/p/mintty/wiki/Keycodes#Ctrl
> http://code.google.com/p/mintty/wiki/Keycodes#Special_keys
>
> See also this on how those keycodes could be put to use in the stty settings:
>
> http://code.google.com/p/mintty/wiki/Tips#Terminal_line_settings
Nice. I didn't know that was there. How hard would it be for me to get 
ncurses to grok these codes?

>> (these questions are partly triggered by frustration at shift+enter not
>> working, which lead to me finding a reasonably sane proposal to fix these
>> kinds of terminal woes [1]; I was surprised to find that mintty can already
>> distinguish some key presses that xterm can't)
>>
>> [1] www.leonerd.org.uk/hacks/fixterms/
> Hmm, that basically describes xterm's "modifyOtherKeys" mode, which
> mintty supports too. This can be enabled with the sequence "\e[>4;1m".
> (That's for level 1. There's also level 2, enabled with "\e[>4;2m",
> where the suggested CSI u keycodes are sent even for Ctrl+letter
> combinations.)
... except neither mode makes any visible difference in xterm-281-1: 
shift+enter and ctrl+enter both continue sending CR, and alt+enter still 
does nothing (level 1); ctrl+a still sends ^A. Mintty works as 
advertized on both counts, yet another reason to like mintty, I guess.

Thanks,
Ryan


--
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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-07-19 20:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-19 15:38 mintty and modifier keys Ryan Johnson
2012-07-19 16:56 ` Aaron Schneider
2012-07-19 17:20   ` Christopher Faylor
2012-07-19 19:06 ` Andy Koppe
2012-07-19 20:32   ` Ryan Johnson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).