cmd pops up when watch mode triggers app restart #2297
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 43.3k
- Forks
- 2.7k
- PR merge metrics
- No merged PRs in 30d
Description
On Windows when an application is started in watch mode via pm2 start app.js --watch and a watched file is changed, pm2 opens a new cmd window with empty content which is closed immediately afterwards. The application is restarted successfully, but the quick popping up of a new cmd window is irritating, especially when you are working in a text editor/IDE and you are losing the keyboard focus because of the opened cmd.
Expected behaviour
pm2 restarts the watched application without opening a new cmd window
Actual behaviour
pm2 restarts the watched application with a briefly showing new cmd window
Steps to reproduce
on Windows, start a simple application in --watch mode
change a watched file
observe that a new cmd window is opened and closed quickly in succession
Software versions used
OS : Windows 10 x64
PM2 Log output
Use the command: tail --lines 50 ~/.pm2/pm2.log
No log output
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing PM2's watch-mode restart path on Windows and identify the child-process launch entry point that causes the temporary cmd window. Reproduce with pm2 start app.js --watch, then change a watched file and observe the restart. Done means the application still restarts successfully without opening a new cmd window.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100