Skip to content
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

Exits program on ESC is slow #31

Open
elhoucine opened this issue Dec 6, 2018 · 3 comments
Open

Exits program on ESC is slow #31

elhoucine opened this issue Dec 6, 2018 · 3 comments

Comments

@elhoucine
Copy link

In my CLI, I noticed after running ntl and pressing ESC key it takes few milliseconds before exiting. All the other actions execute immediately.

In the following screenshot, I pressed The ESC button and highlighted the mouse at the same time.

ntl-esc-slow

@ruyadorno
Copy link
Owner

hi @elhoucine I can confirm I'm able to reproduce the same problem in my system (iTerm on OSX 10.14.2)

interesting thing is that the listener to ESC button is quite a simplistic implementation as you can see:

ntl/cli.js

Line 51 in 98a6e55

process.stdin.on("keypress", (ch, key) => {

I'm currently unable to dig down the rabbit hole but if this rings a bell to anyone, feel free to comment so that we can fix this in the future 😊

@ruyadorno
Copy link
Owner

ooohh I found it, there's a configurable timeout in nodejs realine api 😅 only took me 2 years to figure it out, will patch in the next release

@elhoucine
Copy link
Author

Sounds good, Thank you :D 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants