Unitech / Unitech/pm2

cmd pops up when watch mode triggers app restart #2297

Open
#5,564 0 comments 1 reaction 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.