Development record
After round 4 of the guard fixes (iss-2610111809142536), a cd whose option word has letters neither shell takes (`cd -x sub`) still leaves the directory unknown, so a following `bash s.sh` is allowed unread, while zsh reads the line as its substitution form (replacing `-x` in the current path with `sub`) when that string occurs in the path. Noted by guard round 4 on 2026-10-11; the same allow-unread held before round 3.
issueresolvedminoriss-2610111851225403
After round 4 of the guard fixes (iss-2610111809142536), a cd whose option word has letters neither shell takes (cd -x sub) still leaves the directory unknown, so a following bash s.sh is allowed unread, while zsh reads the line as its substitution form (replacing -x in the current path with sub) when that string occurs in the path. Noted by guard round 4 on 2026-10-11; the same allow-unread held before round 3.
Frontmatter
| id | iss-2610111851225403 |
|---|---|
| type | issue |
| lifecycle | resolved |
| severity | minor |
.abcd/work/issues/resolved/iss-2610111851225403-guard-cd-unknown-letters-zsh.md
open on GitHub ↗ · commit history ↗
mentions1
- iss-2610111809142536zsh reads `cd X Y` with two operands, and an option word it does not take (`cd -e X`, `cd -@ X`, `pushd -n X`), as the substitution form: it replaces the first word in the current directory's path with the second and enters the result, so the guard's script reader judges a script in one directory while zsh runs the one in another. Found by the Fable review of guard round 2 on 2026-10-11 (reproduced with zsh 5.9: `cd <p>/with-n/dir && pushd -n sub && pwd` prints <p>/withsub/dir); the cd forms predate that round, and round 2 made pushd -n read as staying put.