1

emacs (v.26.3) can distinguish, out of the box, C-M-v (scroll-other-window) and C-M-S-v (scroll-other-window-down).

On the other hand, emacs -nw, when run in either gnome-terminal, mate-terminal or xterm, translates C-M-S-v to C-M-v, even when I explicitly set the former.

(Also, as a side note, xterm demands I use ESC rather than the "Alt" key, which is actually "Meta". Bonus question: why?)

Anyone know how I can deal with this?

Diagon
  • 133
  • 6
  • 1
    Can your terminal distinguish `C-M-v` from `C-M-S-v` outside Emacs? – Drew Jun 09 '20 at 18:02
  • @drew -I'm not sure how to check that. In a [pervious question](https://stackoverflow.com/a/34102190) I ran `cat` at the terminal & checked the output (in that case of M-) by typing the key combinations. In this case, on `xterm`, neither C-M-v nor C-M-S-v produce any output, though `emacs` does respond to them. On `gnome-terminal`, I'm not getting something that makes sense to me. C-M-v produces on the terminal "^[^" (without the quotes), but then when I follow it with another key, say "a", the second "^" disappears & I get "^[a". It is true that C-M-S-v produces the same result. – Diagon Jun 10 '20 at 02:39
  • Hopefully someone knowledgeable can help. `^[` is `CONTROL-[`, which is the ASCII `ESCAPE` control character (one char, written `^[` sometimes). So `^[^` would be `ESC-^` and `^[a` would be `ESC-a`. I'm guessing you need to do something with the terminal itself, but maybe someone will suggest a solution from within Emacs. Otherwise, maybe try googling for escape control sequences and terminal. Maybe this is a start: http://www.termsys.demon.co.uk/vtansi.htm. Or this: https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences – Drew Jun 10 '20 at 03:18
  • Does this answer your question? [How can I use Emacs and iTerm for the same keybinding?](https://emacs.stackexchange.com/questions/56128/how-can-i-use-emacs-and-iterm-for-the-same-keybinding) – Drew Dec 21 '20 at 22:58
  • Thanks, Drew, but there the conflict is between the OS swallowing the keys before they get to emacs. They never make it that far. Here the keys are not swallowed. Instead, emacs doesn't distinguish two different key combinations. Either the terminal program is doing some translation, or`emacs -nw` is for some reason ignoring the explicit setting. – Diagon Dec 25 '20 at 00:52

0 Answers0