Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Fixes #2865. Unknown character sequence while resizing terminal. #2951
Fixes #2865. Unknown character sequence while resizing terminal. #2951
Changes from 2 commits
bfa76a2
2411b8a
6af9e83
164f1b7
fee503e
1516580
6603935
68805cf
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As an example, this would be more readable if it were
if (wch == (int)Key.Esc)
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may be smart enough, or have a good enough memory to remember what all these integers are, but I'm not.
Where do these codes come from? They're not ASCII codes. What are they?
I'm asking you to please make this code more readable and maintainable while you are in here.
We should always be making code we touch simpler and more readable, even if we understand it ourselves.
I have just spent 10 minutes trying to figure out where 108, 109, ...121 come from. No reader of the code should need to do that! And I still don't have a clue other than what the curses
get_wch
docs say: https://invisible-island.net/ncurses/man/curs_get_wch.3x.html (and that wasn't helpful).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found this:
https://stackoverflow.com/questions/3202629/where-can-i-find-a-list-of-mac-virtual-key-codes/16125341#16125341
Seems to imply shift is
56
.Anyway, I thought the whole point of ncurses was to map things up to the API.
I think there is some sort of termcap setting that will cause ncurses on the mac to surface these using the
Curses.Key
defines?