I'm on latest debian testing with i3wm on two different laptops.

Linux mango 4.19.0-2-amd64 #1 SMP Debian 4.19.16-1

When I press LeftAlt + x I get "ø". And other special chars with other keys.

I want to disable it, as I assume it is what is stopping me from using Alt-x in emacs, which should be bound to "execute-extended-command" by default. But it only says "ø is undefined".

It does not seem to be the compose key though, as running:

setxkbmap -model pc105 -option compose:caps

Does not affect Alt-x's behavior. Where is this configured?

Update to clarify: I'm using uxterm and terminal emacs "-nw". I added XTerm.vt100.metaSendsEscape: true to .Xdefaults and .Xresources but it had no effect.

Here is the output of xkbcomp $DISPLAY - https://pastebin.com/BFnV4Zdz

  • No it is not the compose key: This key works very differently e.g. «compose» followed by o followed by /, to get ø. – ctrl-alt-delor Mar 9 '19 at 10:38
  • Have you tried «super key» +x? «super key» is the one with a logo on it. – ctrl-alt-delor Mar 9 '19 at 10:39
  • @ctrl-alt-delor I use the windows key as modifier for i3wm. Super+x locks my screen. – user640916 Mar 9 '19 at 13:38

That's curious; it's the Right Alt which is AltGr and should generate such characters, but no file under /usr/share/X11/xkb seems to map AltGr+x to ø.

I suspect that you're running emacs in a terminal emulator -- in which case you should let the terminal emulator map Alt to Esc instead; in xterm, you can do that with

*.vt100.metaSendsEscape: true

If you're not running emacs in a term emulator, then please post the whole output of xkbcomp $DISPLAY - somewhere and link it from your question.

| improve this answer | |
  • Sorry, I should have added that myself. Yes, I run uxterm and emacs -nw but I get the ø also outside of emacs. I added the output to my question. Thank you :) – user640916 Mar 9 '19 at 13:40
  • 1
    if it's uxterm, you should probably use UXTerm.vt100.... Try with uxterm -xrm '*.vt100.metaSendsEscape: true', and if it works, add that to ~/.Xresources. – mosvy Mar 9 '19 at 13:45

It might be built into the application (emacs itself, or a terminal if you're using "emacs -nw"). xterm does this, for instance (as documented originally in the eightBitInput resource, or later, in metaSendsEscape), and some other programs (such as st) copy it.

The feature was implemented in xterm in 2003:

modify handling of eightBitInput resource in UTF-8 mode to translate the value into UTF-8. Otherwise an illegal UTF-8 code is sent to the application (report by Bram Moolenaar).

| improve this answer | |
  • When I run xterm instead of uxterm, alt+x indeed behaves differently. Like backspace – user640916 Mar 9 '19 at 13:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.