ntl icon indicating copy to clipboard operation
ntl copied to clipboard

Exits program on ESC is slow

Open elhoucine opened this issue 6 years ago • 3 comments

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

elhoucine avatar Dec 06 '18 10:12 elhoucine

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 avatar Feb 11 '19 18:02 ruyadorno

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

ruyadorno avatar Feb 08 '21 16:02 ruyadorno

Sounds good, Thank you :D 👍

elhoucine avatar Feb 17 '21 14:02 elhoucine