node.jswindowsbatch-filephpstormphpstorm-2017.2

Asking for input in Windows batch script with PhpStorm and NPM only returns first letter?


This simple script run using PhpStorm's NPM scripts terminal only returns the first letter given by input.

Does anyone know how to fix this? for now I've changed the npm script to start cmd.exe and let it open in a new window. But I'd prefer to keep it in the original terminal.

Script (input.bat)

set /p TEST="Yes?: "
echo %TEST%

NPM:

{
    ...
    "scripts": {
        ...
        "tooling:test": "D:/development/vhosts/domain/tooling/input.bat"
    },
    ...
}

Output

"C:\Program Files (x86)\JetBrains\PhpStorm 2017.1\bin\runnerw.exe" "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" run tooling:test --scripts-prepend-node-path=auto

> tooling:test D:\development\vhosts\domain
> D:/development/vhosts/domain/tooling/input.bat


D:\development\vhosts\domain>set /p TEST="Yes?: " 
Yes?: cheese

D:\development\vhosts\domain>echo c 
c

Process finished with exit code 0

Solution

  • Logged as WEB-31162, please vote for it to be notified on any progress