help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: vterm and Meta?


From: Spencer Baugh
Subject: Re: vterm and Meta?
Date: Thu, 03 Aug 2023 15:56:34 -0400
User-agent: Gnus/5.13 (Gnus v5.13)

hw <hw@adminart.net> writes:

> On Tue, 2023-08-01 at 11:05 -0400, Spencer Baugh wrote:
>> hw <hw@adminart.net> writes:
>> > On Tue, 2023-08-01 at 14:12 +0200, Thibaut Verron wrote:
>> > > Hi,
>> > > 
>> > > Are you using emacs in a terminal?
>> > 
>> > sometimes
>> > 
>> > > If not, Meta is usually bound to a modifier key (afaik by default the 
>> > > one immediately left of the space bar, e.g. alt on PC keyboards), and 
>> > > that works in vterm.
>> > 
>> > Uhm, I've been using emacs for over 30 years and in all these years,
>> > the ESC key was always used for a meta key across all instances by
>> > default.  It's the same when running emacs in a terminal, as an X11
>> > client or with wayland.
>> > 
>> > The key left of the space bar has always been the Alt key on all PC
>> > keyboards I've used so far.  Pressing, for example, Alt-x, inserts x
>> > into the buffer (like into this buffer I'm writing this reply in, and
>> > into the vterm buffer).
>> > 
>> > How is it that it's different for you?
>> > 
>> > > If you don't usually run programs using the Esc key in vterm, you can 
>> > > unbind it and send it with vterm-send-next-key when necessary.
>> > 
>> > Hm, true, I can try that.  It's not like I need the ESC key too often
>> > in a terminal.  Somehow I didn't think of that, thank you :)
>> > 
>> > But then, maybe it makes sense to reconfigure things to use the Alt
>> > key instead of ESC?  Apparently Alt doesn't do anything now and may be
>> > less awkward to type.  Hmm ...
>> 
>> It's possible to separate these in graphical frames.  I think you could
>> 
>> (define-key local-function-key-map (kbd "<escape>") nil)
>> 
>> to make <escape> no longer map to ESC.  Then you can remove the ESC
>> binding in vterm and add an <escape> binding.  Then Meta bindings and
>> <escape> will be separate.
>> 
>> (I know this because I figured it out for some evil-mode users and wrote
>> it up here: https://github.com/emacs-evil/evil/issues/1780 )
>
> Cool, only when I disable the only Meta key I have, I won't have a
> Meta key at all, would I?  I'd have to somehow configure some of the
> Alt keys as Meta first.

No.  Alt will still be translated to send ESC, so it will still work as
Meta.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]