Skip to content

Commit

Permalink
Avoid delay when pressing 'esc'
Browse files Browse the repository at this point in the history
Avoiding the small (but very noticeable) delay terminals have by default when
pressing the 'esc' key. Caught and fix proposed by patacca.
  • Loading branch information
atagar committed May 15, 2016
1 parent 67c22a1 commit b3a0518
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions nyx/starter.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def main(config):
_setup_freebsd_chroot(controller)
_notify_of_unknown_events()
_use_english_subcommands()
_use_no_esc_delay()
_use_unicode()
_set_process_name()

Expand Down Expand Up @@ -224,6 +225,16 @@ def _use_english_subcommands():
os.putenv('LANG', 'C')


def _use_no_esc_delay():
"""
Make it so pressing 'esc' takes effect right away...
https://stackoverflow.com/questions/27372068/why-does-the-escape-key-have-a-delay-in-python-curses/28020568#28020568
"""

os.putenv('ESCDELAY', '0')


@uses_settings
def _use_unicode(config):
"""
Expand Down

0 comments on commit b3a0518

Please sign in to comment.