Code Monkey home page Code Monkey logo

Comments (9)

anonghuser avatar anonghuser commented on June 19, 2024 1

PSA: Another workaround is to use SIGTERM or SIGINT instead of the default to restart your app, i.e.:
nodemon -s sigterm -I test.js
This works because the default SIGTERM and SIGINT handlers in node programs restore the terminal mode before exiting. It would not work when the handlers are overridden and exit without restoring the terminal mode though.

Weirdly enough, the documentation for --signal in nodemon --help options says the default is SIGTERM so it should've worked by default. But apparently the documentation is wrong. I misread it, it just gave SIGTERM as an example, it did not claim it was the default.

from nodemon.

anonghuser avatar anonghuser commented on June 19, 2024

This issue impacts use of readline-based interactive apps with nodemon, i.e. any app making use of the repl built-in module, including node's own interactive mode. So you can reproduce it even without a test script, i.e.:
nodemon -I -x "node "
(for some reason nodemon throws a fit if you try to --exec node, thus the extra space)
(you still need to change some js file in the current directory to trigger the restarts)

from nodemon.

anonghuser avatar anonghuser commented on June 19, 2024

PSA: To exit nodemon when this happens to you (or when triggering it on purpose for debugging) you can kill it from another terminal with pkill -f nodemon. Hopefully you don't have other important things with "nodemon" in their command line 😛

from nodemon.

anonghuser avatar anonghuser commented on June 19, 2024

This may or may not be related, but sometimes when running my repl app in nodemon, I get a weird behavior where my input is not always registered by my app. Some keystrokes don't reach my app, and some do, randomly and unpredictably.
It's a bit as if two processes are reading from stdin (if that's even possible) and it's a cointoss if the input will reach the correct one. However, I'm not sure of the reproduction steps and such, so I've not reported it yet.

from nodemon.

ajnozari avatar ajnozari commented on June 19, 2024

PSA: Another workaround is to use SIGTERM or SIGINT instead of the default to restart your app, i.e.: nodemon -s sigterm -I test.js This works because the default SIGTERM and SIGINT handlers in node programs restore the terminal mode before exiting. It would not work when the handlers are overridden and exit without restoring the terminal mode though.

Weirdly enough, the documentation for --signal in nodemon --help options says the default is SIGTERM so it should've worked by default. But apparently the documentation is wrong. I misread it, it just gave SIGTERM as an example, it did not claim it was the default.

This worked for me nodemon see's the app "crashed" on ctrl+c (app exit(0)). This puts nodemon in watch mode to wait for changes before restarting where I can now ctrl+c again to exit nodemon.

This works well enough for me as it lets me kill the app without exiting nodemon entirely.

from nodemon.

github-actions avatar github-actions commented on June 19, 2024

This issue has been automatically marked as idle and stale because it hasn't had any recent activity. It will be automtically closed if no further activity occurs. If you think this is wrong, or the problem still persists, just pop a reply in the comments and @remy will (try!) to follow up.
Thank you for contributing <3

from nodemon.

anonghuser avatar anonghuser commented on June 19, 2024

idk how long should i bump...

from nodemon.

github-actions avatar github-actions commented on June 19, 2024

This issue has been automatically marked as idle and stale because it hasn't had any recent activity. It will be automtically closed if no further activity occurs. If you think this is wrong, or the problem still persists, just pop a reply in the comments and @remy will (try!) to follow up.
Thank you for contributing <3

from nodemon.

github-actions avatar github-actions commented on June 19, 2024

Automatically closing this issue due to lack of activity

from nodemon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.