Emacs M- (Alt) key not working for some combinations inside the terminal #8088

Closed
opened 2026-01-31 01:20:30 +00:00 by claunia · 4 comments
Owner

Originally created by @Themistoklis on GitHub (May 12, 2020).

Environment

Windows build number: 10.0.18362
Windows Terminal version (if applicable): 0.11.1251.0

Any other software?

  • emacs
  • wsl (I haven't tried emacs for Windows inside the Windows Terminal)

Reproduce

  1. Open emacs in WSL using Windows Terminal.
  2. Use the describe key (C-h k or M-x describe-key)
    • M-left
    • M-right

I think there might be other combinations that do not work but I didn't try them all.

Expected result

Using the normal terminal with WSL or MinTTY for WSL:

  • M-left -> emacs detects it and displays M-left and the function attached
  • M-right -> emacs detects it and displays M-right and the function attached

Result inside the Windows Terminal

  • M-left -> nothing happens
  • M-right -> nothing happens

Note

C-right or C-left work correctly for example.

Wheel scroll don't work either, it is not captured and passed to emacs. The terminal scrolls normally (which it shouldn't) and you get out of emacs boundaries. See other xterm related issues.

Originally created by @Themistoklis on GitHub (May 12, 2020). # Environment Windows build number: 10.0.18362 Windows Terminal version (if applicable): 0.11.1251.0 Any other software? - emacs - wsl (I haven't tried emacs for Windows inside the Windows Terminal) # Reproduce 1. Open emacs in WSL using Windows Terminal. 2. Use the describe key (C-h k or M-x describe-key) - M-left - M-right I think there might be other combinations that do not work but I didn't try them all. # Expected result Using the normal terminal with WSL or MinTTY for WSL: - M-left -> emacs detects it and displays M-left and the function attached - M-right -> emacs detects it and displays M-right and the function attached # Result inside the Windows Terminal - M-left -> nothing happens - M-right -> nothing happens # Note C-right or C-left work correctly for example. **Wheel scroll don't work either, it is not captured and passed to emacs. The terminal scrolls normally (which it shouldn't) and you get out of emacs boundaries. See other xterm related issues.**
claunia added the Issue-QuestionNeeds-Tag-FixResolution-Answered labels 2026-01-31 01:20:30 +00:00
Author
Owner

@DHowett-MSFT commented on GitHub (May 13, 2020):

Thanks for the report! There's two things here.

  1. I believe this is caused by the default pane motion bindings on alt+arrow. You can unbind them in your local settings file.
    • (we know that keyboards are tight real estate. I'm sorry about us stomping on inputs that some applications care about!)
  2. This sounds like "alternate scroll" mode (DECSET 1007). Conhost supports it, and so does Terminal, but we're missing one critical bit of infrastructure. Terminal doesn't know that an "alternate buffer" is in use, and so will not use alternate scroll. That'll be #381.
@DHowett-MSFT commented on GitHub (May 13, 2020): Thanks for the report! There's two things here. 1. I believe this is caused by the default pane motion bindings on alt+arrow. You can unbind them in your local settings file. * (we know that keyboards are tight real estate. I'm sorry about us stomping on inputs that some applications care about!) 2. This sounds like "alternate scroll" mode (DECSET 1007). Conhost supports it, and so does Terminal, but we're missing one critical bit of infrastructure. Terminal doesn't know that an "alternate buffer" is in use, and so will not use alternate scroll. That'll be #381.
Author
Owner

@Themistoklis commented on GitHub (May 13, 2020):

Thanks for the input.

  1. Unbinding alt+up/down/left/right worked fine (I didn't even realize they were bound to something)
    • Suggestion 1: put all unbound-able keybindings inside the settings file
    • Suggestion 2: like for the scroll, redirect keybindings to the buffer instead of using them in Terminal under the "alternate buffer" mode
  2. //
@Themistoklis commented on GitHub (May 13, 2020): Thanks for the input. 1. Unbinding alt+up/down/left/right worked fine (I didn't even realize they were bound to something) - Suggestion 1: put all unbound-able keybindings inside the settings file - Suggestion 2: like for the scroll, redirect keybindings to the buffer instead of using them in Terminal under the "alternate buffer" mode 2. //
Author
Owner

@DHowett-MSFT commented on GitHub (May 14, 2020):

Good idea in number 2 for the alternate buffer. We'd need to spec that, because it'll be a big departure from how other terminals work.

All of the unbindable keys actually are available in the settings file. We've unfortunately failed to document it appropriately:

image

image

@DHowett-MSFT commented on GitHub (May 14, 2020): Good idea in number 2 for the alternate buffer. We'd need to spec that, because it'll be a big departure from how other terminals work. All of the unbindable keys actually are available in the settings file. We've unfortunately failed to document it appropriately: ![image](https://user-images.githubusercontent.com/14316954/81883796-03611000-954b-11ea-9325-02aee431f6bd.png) ![image](https://user-images.githubusercontent.com/14316954/81883821-14118600-954b-11ea-9f93-316598d9c7cb.png)
Author
Owner

@jiucenglou commented on GitHub (Feb 9, 2021):

It seems that <Alt>-<Shift>-<Enter> does not work with Windows Terminal. Could you suggest the solution ?

@jiucenglou commented on GitHub (Feb 9, 2021): It seems that `<Alt>-<Shift>-<Enter>` does not work with Windows Terminal. Could you suggest the solution ?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#8088