mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-10-31 03:46:24 +08:00
Replace `$PWD` with `$(pwd -P)` when capturing the working directory in zsh and bash login shell invocations. When the child shell inherits a stale PWD environment variable — common in CI where the spawner's cwd differs from the session directory — `$PWD` can point to the wrong location, causing `cd "$__oc_cwd"` to silently escape the intended directory. `pwd -P` queries the kernel via getcwd(), ensuring the correct physical path is always used. The corresponding test is updated with richer cwd diagnostics to validate the fix and surface root-cause information on failure.