How to hide node cmd windows created by "pm2 start"

enter image description here

One cmd window for the node process, I do not know what these windows are for. Can I hide them?

+7
source share
2 answers

What you can do, well ... in my case, I'm using Visual Studio Code, you forgot to include your IDE in your question. Now I have integrated the terminal with VSC, so in fact I do not have three windows floating around. Now there is work with windows, which Mac does not exist, to have 3 windows that you would have to include in your settings:

//Terminal Configurations //PowerShell Windows //"terminal.integrated.shell.windows": "C:\\WINDOWS\\system32\\cmd.exe", //GIT Bash Configuration "terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe", 

so when you clik on the plus, it will create a β€œnew window”, but will not pop up, look:

enter image description here

By the way, you cannot activate both at the same time, one for bash, one for cmd, I use cmd for my mongodb and bash for the rest.

You can also replace bash or cmd for the nodejs command line, if you want, just put it on one of the routes above :)

Hope it helps!

0
source

Using AutoHotkey, I solved this problem for me on Windows. This will add a tray icon in the notification area of ​​the taskbar (somewhere near the clock). You can also stop the script and the node.js script by right-clicking this icon, then "Exit".

 #SingleInstance, force OnExit, ExitSub RunWait, node "main.js", % A_ScriptDir, Hide, pid ExitApp ExitSub: Process, close, % pid ExitApp 

With %comspec% you can write output to a file if necessary. Then it will look like RunWait, %comspec%/c "node "main.js" > "log.txt""

0
source

Source: https://habr.com/ru/post/1013140/


All Articles