mintty + emacs + ctrl-alt-shift-number

167 views
Skip to first unread message

Dmytro Suvorov

unread,
Feb 23, 2011, 3:57:15 AM2/23/11
to mintty
C-M-% preforms regexp replace in emacs. This works fine in default
cygwin terminal, but not in mintty.
What I get back from emacs is: "M-[ 1 ; 8 u is undefined"

I know I can map "M-[ 1 ; 8 u" to whatever I want in .emacs, but that
seems like not a good way to do it.
I've read an earlier post (http://cygwin.com/ml/cygwin/2010-05/
msg00389.html) that it might be an issue with modifyOtherKeys. I tried
enabling it in mintty (by using echo -ne "\e[>4;1m" in bash), but then
it simply prints ;8u (in color) in emacs when I press ctrl-alt-
shift-5.

cygwin-1.7.7-1/mintty-0.9.6-1/emacs-23.2-3.
win7-64bit, if that matters.

Thanks!

P.S. Thanks for mintty ;) I'm loving it and I think it should be the
default cygwin terminal :)

Andy Koppe

unread,
Feb 23, 2011, 7:37:53 AM2/23/11
to mintty
On Feb 23, 8:57 am, Dmytro Suvorov wrote:
> C-M-% preforms regexp replace in emacs. This works fine in default
> cygwin terminal

I can't see how. The Cygwin console driver does not translate that key
combination into an escape sequence, as there is no ^% control
character and it doesn't implement any other scheme.

Were you using native emacs instead of Cygwin emacs? That would be
using the Windows console API directly.

> but not in mintty.
> What I get back from emacs is: "M-[ 1 ; 8 u is undefined"

That sequence is as documented at
http://code.google.com/p/mintty/wiki/Keycodes#Number_and_symbol_keys.

> I know I can map "M-[ 1 ; 8 u" to whatever I want in .emacs, but that
> seems like not a good way to do it.

I'm afraid that's what you'll have to do, because there are no
standard keycodes for such combinations (but see below).

> I've read an earlier post (http://cygwin.com/ml/cygwin/2010-05/
> msg00389.html) that it might be an issue with modifyOtherKeys. I tried
> enabling it in mintty (by using echo -ne "\e[>4;1m" in bash), but then
> it simply prints ;8u (in color) in emacs when I press ctrl-alt-
> shift-5.

Mintty actually sends '\e[37;8u' in that case, whereby the 37 is the
ASCII code for '%' and the 8 encodes Ctrl+Shift+Alt. This
modifyOtherKeys mode comes from xterm and is the closest there is to a
standard for such combinations, but I'd be surprised if emacs
supported it out-of-the-box.

> P.S. Thanks for mintty ;) I'm loving it and I think it should be the
> default cygwin terminal :)

You're welcome!

Andy

Dmytro Suvorov

unread,
Feb 23, 2011, 6:25:40 PM2/23/11
to mintty


On Feb 23, 6:37 am, Andy Koppe <andy.ko...@gmail.com> wrote:
> On Feb 23, 8:57 am, Dmytro Suvorov wrote:
>
> > C-M-% preforms regexp replace in emacs. This works fine in default
> > cygwin terminal
>
> I can't see how. The Cygwin console driver does not translate that key
> combination into an escape sequence, as there is no ^% control
> character and it doesn't implement any other scheme.
>
> Were you using native emacs instead of Cygwin emacs? That would be
> using the Windows console API directly.
You're right. I does not work. I was using cygwin emacs, but
apparently I pressed Alt-Shift-5 (which is simply replace) and not
Ctrl-Alt-Shift-5.
So it's not a mintty problem after all (not directly at least, would
be great if emacs was working out of the box).
>
> > but not in mintty.
> > What I get back from emacs is: "M-[ 1 ; 8 u is undefined"
>
> That sequence is as documented athttp://code.google.com/p/mintty/wiki/Keycodes#Number_and_symbol_keys.
>
> > I know I can map "M-[ 1 ; 8 u" to whatever I want in .emacs, but that
> > seems like not a good way to do it.
>
> I'm afraid that's what you'll have to do, because there are no
> standard keycodes for such combinations (but see below).

Yeah, that's what I would do.
Thanks for your help!
Reply all
Reply to author
Forward
0 new messages