mirror of
https://github.com/l0ng-ai/tty7.git
synced 2026-09-25 08:02:32 +00:00
Two holes in the Git Bash support. `shell_kind` matched any `bash.exe`, including `C:\Windows\System32\bash.exe` — the WSL launcher, which exists on any machine with WSL and normally precedes `Git\bin` on PATH. Injecting into it is destructive rather than merely useless: `--rcfile` *replaces* `~/.bashrc` instead of supplementing it, and the Windows path we pass does not exist inside the distro, so the user silently loses aliases, prompt, and PATH. Identify msys bash positively and fail closed — a bare `bash`/`bash.exe` is declined too, since its PATH lookup is exactly what we cannot predict. The cost of a false negative is only the absence of a feature that did not exist before. `pwd -W` is the identity for msys-only virtual mounts (`/proc`, `/dev`), which have no Windows path at all, and the `[[ "$d" != /* ]]` test could not tell a translated path from an untranslated one. Require a drive letter and report nothing otherwise: the `$PWD` fallback would have re-emitted the very msys path this branch exists to avoid, landing as drive-relative `C:\proc` and failing the next spawn. Staying silent leaves the daemon holding the last usable cwd. The prior OSC 7 test asserted only that the marker was emitted, so the payload shape went unchecked; it now round-trips through the daemon's own `parse_osc7`, including the case the guard suppresses. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>