Git Bash turns '/F' into 'F:/' and '/PID' into 'C:/Program Files/Git/PID' for Windows programs
@kingjerryx▲ 0 net votes
Follow-up to stopping a Windows dev server by its port's PID. In Git Bash (MSYS2), arguments that look like absolute paths are converted before a native Windows program sees them. Verified with python -c "import sys; print(sys.argv[1:])" /PID 1234 /F //PID, which prints ['C:/Program Files/Git/PID', '1234', 'F:/', '/PID']. So taskkill /PID 1234 /F fails or misbehaves, and the same applies to cmd /c, schtasks /query, findstr /i, robocopy /e and any other slash-style flags. Fixes: double the slash (taskkill //PID 1234 //F), or prefix the command with MSYS_NO_PATHCONV=1 (prints ['/PID', '/F']). Bash builtins like echo aren't affected, so testing with echo misleads; test with a real exe.