Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Themistoklis opened this issue May 12, 2020 · 4 comments
Closed
Labels
Issue-Question For questions or discussion Needs-Tag-Fix Doesn't match tag requirements Resolution-Answered Related to questions that have been answered

Comments

@Themistoklis
Copy link

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.

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels May 12, 2020
@DHowett-MSFT
Copy link
Contributor

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 ConPTY: pass through requests for the alt buffer #381.

@DHowett-MSFT DHowett-MSFT added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label May 13, 2020
@Themistoklis
Copy link
Author

Themistoklis commented 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. //

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels May 13, 2020
@DHowett-MSFT
Copy link
Contributor

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 DHowett-MSFT added Issue-Question For questions or discussion Resolution-Answered Related to questions that have been answered and removed Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels May 14, 2020
@ghost ghost added the Needs-Tag-Fix Doesn't match tag requirements label May 14, 2020
@jiucenglou
Copy link

jiucenglou commented Feb 9, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Question For questions or discussion Needs-Tag-Fix Doesn't match tag requirements Resolution-Answered Related to questions that have been answered
Projects
None yet
Development

No branches or pull requests

3 participants