-
-
Notifications
You must be signed in to change notification settings - Fork 42
Ticket #4096: use set_escdelay interface instead of ESCDELAY var
#4798
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -230,17 +230,17 @@ tty_init (gboolean mouse_enable, gboolean is_xterm) | |
|
|
||
| initscr (); | ||
|
|
||
| #ifdef HAVE_ESCDELAY | ||
| #ifdef HAVE_SET_ESCDELAY | ||
| /* | ||
| * If ncurses exports the ESCDELAY variable, it should be set to | ||
| * a low value, or you'll experience a delay in processing escape | ||
| * sequences that are recognized by mc (e.g. Esc-Esc). On the other | ||
| * hand, making ESCDELAY too small can result in some sequences | ||
| * (e.g. cursor arrows) being reported as separate keys under heavy | ||
| * processor load, and this can be a problem if mc hasn't learned | ||
| * them in the "Learn Keys" dialog. The value is in milliseconds. | ||
| * ESCDELAY variable should be set to a low value, or you'll experience a | ||
| * delay in processing escape sequences recognized by mc (e.g. Esc-Esc). | ||
| * Making ESCDELAY too small can result in some sequences (like cursor | ||
| * arrows) being reported as separate keys under heavy processor load, | ||
| * and this can be a problem if mc hasn't learned them in the "Learn Keys" | ||
| * dialog. The value is in milliseconds (AIX defaults to 0.1s, ncurses 1s). | ||
| */ | ||
| ESCDELAY = 200; | ||
| if (g_getenv ("ESCDELAY") == NULL) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand the design here. Why introduce a brand new (and undocumented) environment variable when There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, I understand that there is a dire need for more explanations :( According to my understanding, the story is as follows: ncurses has its own environment variable called In our code for ncurses, we "disable" their Some time later (from ncurses 5.7 on, if my understanding is correct), a new way was introduced to set this value programmatically: My thinking, however, was to use the new way, but override it only if the The users of old ncurses before 5.7 from circa 2008 would now have to set the My own explanation brings me to the next idea though: as mentioned in #4096, it seems that our What about the ncurses built-in Is Can it be that our There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I set our Anyways, it seems one would need to understand what and why is done in I think my patch here is still an improvement and can be taken... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have surely missed that I'd argue that if That is: if That would be the simplest I could imagine. Let me guess: I've missed something and this approach doesn't handle something correctly, right? :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes, I think that you've missed a part of my explanation. According to my understanding (of the original comment), if we set But I think you have a point that instead of calling I do now have a deeper question though: can we just activate our own stuff (which obviously is not working fully correctly under So the bottom line is, I guess I should just remove the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the explanation! I have to admit, I don't care enough about this issue to really understand all the details and all the design decisions, so please don't block on me, feel free to go ahead with whatever you feel is the best :) |
||
| set_escdelay (100); | ||
| #endif | ||
|
|
||
| tcgetattr (STDIN_FILENO, &mode); | ||
|
|
||
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.
"the ..."
but the whole comment is mildly confusing, because the actual ESCDELAY is an env variable, while we are now setting an internal variable, which would conventionally be lowercase. doesn't really matter, but maybe you have a great idea how to word it better.