Thank you again, Charles, for letting me know how to configure Emacs so
that it recognizes the Meta shortcut keys (e.g., M-x, M-f) sent by the
console, which by default encodes them with the eight bit.
However, I ran into the problem of using Emacs inside tmux under the
console. I thought it was a problem with tmux, so I opened an issue:
https://github.com/tmux/tmux/issues/4189
There I was advised to configure "keyboard1" so that the Meta key is
escaped, i.e., M-x is encoded as ^[x. That made Emacs work without your
configuration, and work with tmux too. Please note it's "keyboard1"
(one), not "keyboard":
wsconsctl keyboard1.encoding=us.metaesc
When I made my initial post here a few months ago, I tried that with
"keyboard", but that didn't help. After reading the docs, I wasn't
aware that "keyboard" seems to be reserved for a legacy keyboard
(wsconsctl reports keyboard.type=pc-xt), while "keyboard1" seems to
represent a USB keyboard (wsconsctl reports keyboard1.type=usb).
One can configure "keyboard1" in /etc/wsconsctl.conf:
keyboard1.encoding=us.metaesc
It's better yet to configure all keyboards in /etc/kbdtype:
us.metaesc
That one line above makes everything work for me.
On 3/19/24 17:25, char...@lisp.mobi wrote:
init.el:
(set-input-mode t nil t)
On 3/19/24 03:07, Irek Szcześniak wrote:
Hi,
I would like to use Emacs in the console, but the problem is the Meta
key. I'm using OpenBSD 7.4 GENERIC.MP#1397 amd64 with regular PC
keyboards where I got used to the left Alt as the Meta key. I know
that instead of using Meta (e.g., Alt+x), I can prefix with Esc, and
then press x. However, I would like to get the left Alt work the way
I'm used to. But how?
Supposedly, this should work:
wsconsctl keyboard.encoding=us.metaesc
However, it doesn't work for me, and I don't know how to diagnose the
problem. I can use Emacs (emacs -nw) in xterm and cwm (from there I
can ssh to a different system and can use Emacs with the left Alt key
allright), where I had to tweak the .Xdefaults:
XTerm*eightBitInput: false
XTerm*eightBitOutput: true
How to get the console work the way I want?
Thanks & best,
Irek