fix(complete): complete paths after ~ and $VAR, and hidden file names #1692
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 640 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.387
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #1692"
general
weight: 0.35
jdx
Path completion returned nothing for words starting with
~,~user,$VAR/or${VAR}/, and for hidden file names. It now completes them and keeps the prefix as typed:This applies to the file fallback and to the
path,file,dir,executableand extension-filtered completers.., including abbreviated parents (.hd/in→.hdir/inner).~or~usercompletes to~/.~useris resolved through the system user database on Unix, and is not expanded on Windows. A$VARis expanded only once a/follows it, and only if it is set and non-empty.usage, so a file literally named$HOMElooks like the variable. The expansion is tried first, and the literal file answers if the expansion finds nothing.$HOME/'My Docs/'), so it still expands. Only paths that completion looked up this way are left unquoted: a declared choice, completer output or literal file name spelled like a variable is still quoted whole. The generated zsh script now uses menu insertion for any quoted match, so regenerate zsh completion scripts to get that part.~in the middle of a word is not offered a home-directory path: behind--flag=or a sigil (@~/…) the shell leaves it unexpanded (zsh expands it after=only withMAGIC_EQUAL_SUBST).--flag=$HOME/…and@$HOME/…complete, as does--flag ~/…../viscompletes to./visiblerather thanvisible, and an absolute path under the current directory stays absolute...completes to../instead of listing unrelated entries.Fixes #1691
Validation
cargo test --all --all-featurespassed after accepting the zsh script snapshots, andmise run lintpassed. Tab was also driven throughcompletion-initin real shells under tmux:~/bi,~/My,$HOME/bi,$HOME/My,${HOME}/biand.hidinserted a word that expanded to the intended path.~/bi,~/My,$HOME/bi,$HOME/Myand.hiddid too. fish has no${HOME}syntax.~/bi,$HOME/bi,${HOME}/biand.hiddid too. Names containing spaces are still inserted unescaped by the bash script, which this PR does not change.PowerShell, Nushell and Windows were not tried interactively.
AI-assisted — Tool: Claude Code; model: anthropic/claude-sonnet-5-5; version: unavailable.
🤖 Generated with Claude Code
<!-- CURSOR_SUMMARY -->
---
<!-- /CURSOR_SUMMARY -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
- Path completion supports home-directory and environment-variable prefixes, partial parent-directory segments, and explicit
..paths while preserving typed prefixes in suggestions.- Hidden entries appear when the typed path segment starts with a dot.
- Improved shell completion for expandable paths and suggestions containing apostrophes.
- Unset or empty environment variables no longer produce path suggestions.
- Added coverage for path completion, hidden entries, candidate collisions, and shell-specific quoting.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->