You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into an issue where when using useInput or ink-select-input; pressing ctrl+c exits the app but not the process.
This is probably because our app has live connections. Is there a way I can subscribe to when the React app exits? I know there's waitUntilExit but I don't think that's accessible via Pastel (correct me if I'm wrong).
If exitOnCtrlC was set to false, I could check for key.ctrl && input === "c" in the useInput callback, and then call process.exit(0). I've confirmed this by editing the hook in node_modules. But:
I shouldn't have to manually handle ctrl+c anyway so this isn't a real solution 🤷♂️.
The workaround I'm using right now is to manually listen to stdin via useStdin. When ctrl+c is pressed (I've copied the logic from useInput), I call process.exit(0).
The awkward thing is that if any third-party component uses useInput, a workaround like this has to be used.
I ran into an issue where when using
useInput
or ink-select-input; pressingctrl+c
exits the app but not the process.This is probably because our app has live connections. Is there a way I can subscribe to when the React app exits? I know there's
waitUntilExit
but I don't think that's accessible via Pastel (correct me if I'm wrong).If
exitOnCtrlC
was set tofalse
, I could check forkey.ctrl && input === "c"
in theuseInput
callback, and then callprocess.exit(0)
. I've confirmed this by editing the hook innode_modules
. But:exitOnCtrlC
at all.ctrl+c
anyway so this isn't a real solution 🤷♂️.The workaround I'm using right now is to manually listen to stdin via
useStdin
. Whenctrl+c
is pressed (I've copied the logic fromuseInput
), I callprocess.exit(0)
.The awkward thing is that if any third-party component uses
useInput
, a workaround like this has to be used.I think this is related to #8
The text was updated successfully, but these errors were encountered: