-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Windows: ESC key only works in "raw" tab (regression, patch inside) #2947
Labels
Comments
avih
changed the title
Windows: ESC only works in "raw" tab (regression, patch inside)
Windows: ESC key only works in "raw" tab (regression, patch inside)
Oct 4, 2023
I'm experiencing the same behavior of the escape not working, but Micro catching it in |
Also seeing this on Windows 11 Enterprise with the latest version of micro (v2.0.113) |
Neko-Box-Coder
added a commit
to Neko-Box-Coder/micro-dev
that referenced
this issue
May 19, 2024
This should fix zyedidia#2947 I will test this on a Windows machine and Linux machine
dmaluka
added a commit
to dmaluka/micro
that referenced
this issue
Jun 10, 2024
According to tcell documentation, Rune() should only be used for KeyRune events. Otherwise its return value is not guaranteed and should not be relied upon. This fixes issue zyedidia#2947: Esc key not working on Windows, since tcell sends lone Esc key event with rune == 0 on Unix but with rune == 27 (the keycode) on Windows.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This issue has been mentioned before, but with no real solution (#1994, #2274).
Description of the problem or steps to reproduce
The ESC key seems to be ignored on Windows, but shows OK at the "raw" tab.
Steps:
Press
Ctrl-e
for command mode.Press ESC
Expected result: The command pane closes
Actual result: nothing happens
If typing
Ctrl-e
and thenraw
and enter, and then pressing ESC, each press shows as:Specifications
Version: 2.0.12
Commit hash: c2cebaa
Compiled on September 06, 2023
Also happens on any pre-built 2.0 version (first pre-built binary is 2.0.0-rc3).
Doesn't happen on the 1.4.1 pre-built binary. I.e. ESC is recognized and the command pane is closed, selection gets deselected, etc.
OS: Windows 10, Windows 7.
Terminal:
Windows 10: native console and Windows terminal (several versions, up to current latest - 1.19).
Windows 7: native console.
Analysis:
The issue appears to be a regression of commit 37a4cbf, by this part of the diff:
And indeed, removing the
code != 27
part of the conditions makes ESC great again on Windows too (I'm guessing only the 2nd condition matters, because Ctrl-ESC is intercepted by the system on Windows. Not sure though).This "fix" works on both windows 7 and 10, both windows terminal and native console, and makes ESC close the command pane, deselect, abort an action which asks
(y,n,esc)
, etc - all of which don't work in the current version on Windows.I don't know if that's a correct fix, but it does seem to suggest that the comment is incorrect on Windows.
The text was updated successfully, but these errors were encountered: