On windows generated *.cmd file overwrites console window title
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 10.1k
- Forks
- 4.7k
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 19
Description
With npm 8.3.1 the *.cmd file generated to run node applications overwrites the current console window title, setting the title to c:\Windows\system32\cmd.exe (the value of the %COMSPEC% environment variable) on exiting the application.
Sample of generated command file:
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\node_modules\npm-test-cmd\npm-test-cmd.js" %*
This is extremely annoying if you have various console windows open and have set titles to help distinguish between them.
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
The issue provides a generated Windows .cmd sample but no repository file or test path. Reproduce the title change on Windows with the npm 8.3.1-style script, then trace where npm generates this command file. Done means running a generated script no longer changes the existing console window title after the application exits.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- cli, operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100