Elius94 / console-gui-tools

A simple library to draw option menu or other popup inputs and layout on Node.js console.
MIT License
106 stars 17 forks source link

[Feature]: Added Support so the Process needs not be ended with process.exit() #84

Closed haeferer closed 3 months ago

haeferer commented 5 months ago

What do you want?

currently the process.exit() is needed for node to end correctly, cause the StdIn Interface is not correctly closed.

Why do you want it?

Implement the GUI correctly even during close.

How do you implement it?

The changes needed can be seen here. I'm not sure if all components are working, but a small implementation does not need the on("exit") process.exit() structure anymore

https://github.com/Elius94/console-gui-tools/compare/main...haeferer:console-gui-tools:main

Now this code works

GUI.on("exit", () => {
    console.clear();
})

you can even remove these lines, if you dont want to clear the console on exit

Are you interested in developing this feature?

Elius94 commented 5 months ago

Hey! thanks. Please make a PR when you are ready