[READ-ONLY] Mirror of https://github.com/plttn/tide. 🌊 The ultimate Fish prompt.

fix(pwd): only clear glob when contains fails, not unconditionally (#43)

## Summary - Fixes the crash from #11 (`set: --erase: option requires an argument` in `_tide_pwd`), which happens when an ancestor directory in `$PWD` is execute-only (searchable but not listable) — `cd` succeeds but the disambiguation glob comes back empty, and `contains -i ... $glob` finds nothing. - Supersedes #12: that PR silenced the crash with `contains ... | echo`, but `echo` doesn't read from stdin, so the substitution is empty **unconditionally**, not just on failure. That erases the entire `$glob` candidate list on every truncation, disabling sibling-directory disambiguation globally (e.g. `foobar` and `foobaz` would both truncate to `f` instead of staying distinguishable). Credit to [faho for catching this](https://github.com/plttn/tide/pull/12#issuecomment-3132534860) on the original PR. - This version only substitutes a full-range erase (`1..-1`) when `contains` actually fails, preserving the original disambiguation behavior in the success path. Verified locally (isolated fish repros, not included as a test suite): - Success-path truncation output is byte-for-byte identical to pristine `main` across unique dirs, hidden dirs, and multi-way ambiguous prefixes. - The permission-denied repro from #11 (execute-only parent dir) no longer crashes and falls back to a minimal, non-crashing truncation. Closes #11 ## Test plan - [ ] `cd` into a directory whose path includes an execute-only (non-readable) ancestor, with terminal narrow enough to force truncation — confirm no error is printed. - [ ] `cd` into two sibling directories sharing a long common prefix (e.g. `foobar`/`foobaz`) with a narrow terminal — confirm each still truncates to a distinguishing prefix rather than collapsing to the same single character. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>


Author Jack Platten Co-author Claude Sonnet 5 Committer GitHub Date Commit Parent 9685fb22
+12 -1
2 changed files
+12 -1
2 changed files