-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Alt arrow keys print extra characters #3101
Comments
I'm having the same issue. Happens in both I use alt-left and alt-right to navigate through words on a command. Terminal version: 0.5.2762.0 |
@DHowett-MSFT This issue is caused by the use of
I'll open a PR. @paulwhiting I was not able to exactly replicate your observed behavior. Is there a way to switch between "keypad mode" on/off? I'm "Press[ing] alt-up, alt-down, alt-right, alt-left" (in that order) and I'm not really certain why I'm getting these different results:
|
I believe num lock should do what you want? My keyboard doesn't have a numeric keypad, just standalone arrow keys. You're not seeing the ABCD characters because your underlying shell is handling those. It's the extra one of ♦◘☻♠ that pops up after letting go of alt that's the problem. |
In my case, the extra keystroke will happens when I "release the Alt key" after pressing Alt+Left/Right/Up/Down. |
can confirm, I too face this. Within tmux, if i switch panes using Alt+direction keys, i get funny chars on the command line |
Hi folks, sorry for stating the obvious. Please review/approve the PR so this can be addressed. Thanks! |
## Summary of the Pull Request This PR potentially fixes #3101. ## PR Checklist * [x] Closes #3101. * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [ ] Tests added/passed * [ ] Requires documentation to be updated * [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx ## Detailed Description of the Pull Request / Additional comments This PR fixes #3101 by setting flag 0 in `ToUnicodeEx()` even though the documentation says "If bit 0 is set, a menu is active.". I'm not 100% sure why it works, but it definitely does in this case. I thought that bit 2, which claims that "keyboard state is not changed" would be sufficient to prevent this from happening, but it seems that's not the case. I believe this PR should be verified by a developer at Microsoft who's familiar with the internal workings of `ToUnicodeEx()`. We need this function (or something similar) to translate Alt+Key combinations to proper unicode. But at the same time it should not send us any additional IBM-style Alt Codes to our character handler if that translation fails (and `ToUnicodeEx()` returns 0). ## Validation Steps Performed See #3101 for more information. I ensured that Alt+Arrow-Key combinations do not print ◘☻♠♦ anymore.
Thanks, everyone! |
🎉This issue was addressed in #3117, which has now been successfully released as Handy links: |
Terminal Version: 0.5.2762.0
Microsoft Windows [Version 10.0.18362.356]
Steps to reproduce
Open terminal. Press alt-up, alt-down, alt-right, alt-left.
(For byobu: start byobu with 'byobu'. Press F2 to add a new tab. Press alt-right and alt-left to switch between tabs.)
Expected behavior
When not running something like byobu perhaps the letters ABCD should be printed out.
When using byobu to manage console sessions it should switch between tabs.
Observed behavior
The text was updated successfully, but these errors were encountered: