[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Meta key for 'emacs -nw'



>> :-)  "There are no dumb questions.  Only dumb answers."
> Okay. Here's one -- I was going to post it in gnu.emacs.help, but you
> changed my mind! Emacs running in X honors Alt as its Meta key. But if
> I launch 'emacs -nw' to avoid running in X that understanding (Meta == Alt)
> evaporates. Perhaps I need to set something specific in my .emacs for
> the minibuffer?

Not really.  Text terminals (e.g. xterm, rxvt, linux console, ...) get
to see your actual key events and transform them into a sequence
of bytes.  The programs that run inside (e.g. bash, Emacs, ...) only get
to see that byte sequence.

That sequence of bytes is not really well defined, for
historical reasons.  So for things like "press the letter t", the
situation is pretty clear, but for "press M-t" it's much less so, not to
mention "press M-C-é" or "move mouse from X,Y to Z,W".

Most like you'll want to tell your text terminal to change the Alt
modifier so that it sends an ESC character (i.e. so Alt-t gets turned
into the sequence of bytes corresponding to the ASCII chars ESC and t).
That's probably the most standard way to deal with this
particular aspect.

For xterm, you set this config the way Don Armstrong showed:

   XTerm*metaSendsEscape: true

in your ~/.Xdefaults or ~/.Xresources.


        Stefan


Reply to: