diff --git a/tools/environments/local.py b/tools/environments/local.py index 4aa6b64e2df0..eb5aa89ab975 100644 --- a/tools/environments/local.py +++ b/tools/environments/local.py @@ -389,6 +389,15 @@ def _kill_process(self, proc): def _update_cwd(self, result: dict): """Read CWD from temp file (local-only, no round-trip needed).""" + if _IS_WINDOWS: + # Windows: Git Bash pwd -P outputs POSIX paths (/c/Users/msn) + # that are invalid for subprocess.Popen(cwd=...). Strip the + # marker from output without overwriting self.cwd. + saved = self.cwd + self._extract_cwd_from_output(result) + self.cwd = saved + return + try: cwd_path = open(self._cwd_file).read().strip() if cwd_path: