ruyadorno / ntl

Node Task List: Interactive cli to list and run package.json scripts
https://www.npmjs.com/package/ntl
MIT License
932 stars 35 forks source link

Exits program on ESC is slow #31

Open elhoucine opened 5 years ago

elhoucine commented 5 years ago

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 commented 5 years ago

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:

https://github.com/ruyadorno/ntl/blob/98a6e5565540a33be97ba72cc97d5e1562016b1e/cli.js#L51

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 commented 3 years ago

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 commented 3 years ago

Sounds good, Thank you :D 👍