You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
path model: cd ~ uses the startup HOME; mkdir succeeds where cd then fails at ~260 chars; pwd and realpath disagree on spelling #754
Three path-model divergences from GNU, all verified. Taxonomy family S10 ("Windows 进程/路径", ~104 commits), the same area the project's own ledger already tracks.
Verified with LF script files; niu (installed 1.4.0) vs WSL GNU bash 5.3.0; stdout/stderr captured separately. A first attempt at item 2 was invalid on my side (I generated the long path with python, which WSL does not have) — re-run below without it.
1. cd ~ uses the HOME captured at startup, not the current $HOME
So a script that changes HOME and then cd ~ lands somewhere else. (Same sweep reports that command cd ~ resolves correctly, i.e. it is the bare builtin path that keeps the stale capture.)
2. mkdir succeeds on a path that cd then refuses — niu can create a directory it cannot enter
GNU's cd works up to ~289. niu's fails from somewhere between 225 and 265 — below the length at which Windows itself refuses to create the directory. So the two operations disagree about the same path, which is the "N paths, separately patched" pattern from S3/S10 rather than one length policy.
3. pwd and realpath disagree on the spelling of the same directory
Any [ "$(pwd)" = "$(realpath …)" ] or case $PWD in $(realpath …) idiom therefore silently fails. (~/$HOME uses yet a third spelling, C:/….) This is the same family as the boundary-table work in niubash#384 and the PWD-form policy in rubash#537.
Not included
Four more items from the same sweep are not re-checked by me and are not part of this issue: pwd -P at / reporting the winuxcmd root; pwd -P vs pwd -L disagreeing after cd /mnt/c/…; ~root / ~nobody staying literal; and ls -d c:foo succeeding on a drive-relative path that [ -e ] and native children refuse.
Method
As above; each case in a fresh directory (a previous sweep retracted two of its own glob/path diffs as run-order pollution, so isolation was enforced here).
One more from the same family as this issue, and it is a script's own positional parameters rather than a native child's:
printf'echo "arg1=[$1]"\n'> argv.sh
niu argv.sh /c/Users/x/repo # $1 arrives as C:\Users\x\repo
niu argv.sh C:/Users/x/repo # $1 arrives as C:/Users/x/repo
bash argv.sh /mnt/c/Users/x/repo # $1 arrives as /mnt/c/Users/x/repo
invocation
what the script sees in $1
niu argv.sh /c/…
C:\…
niu argv.sh C:/…
C:/…
bash argv.sh /mnt/c/…
/mnt/c/…
The translation is consistent with the documented rule ("every other child … always receives native Windows paths" — the child here being niu re-invoking itself), so this may be intended. Filing it against the path model because the recipient is the shell's own $1..$n, where a script author expects what they typed. It is also how I lost a whole probe run: a script that did cd "$1" followed by relative file work landed in a different place than the caller intended, with no diagnostic.
If it is intended, the path contract could say so explicitly for the script-argument case (as it already does for native children), since scripts are the one place a user is most likely to assume verbatim.
Environment: Niubash 1.4.0 (rubash git e785c3c8f610), Windows 10 x64 (build 19045); GNU bash 5.3.0 via WSL; arguments passed to a plain .sh file run as a script.
Duplicate-sweep note: this is residue of the closed path family #329 / #331 / #592 / #537 / #566 / #224
Sweeping the tracker for closed predecessors: the path-model half of this issue belongs to a family that has already been closed six times from six entry points —
$0/BASH_SOURCE rewritten for a script invoked by an absolute /d/ path
Each closed fix covered its entry point; this issue reports the same contract failing from cd ~ (startup vs current HOME) and from cd into a >260-char path. That is residue of the family, not a seventh independent bug.
The ~260-char mkdir-succeeds-but-cd-fails item does look new (no closed predecessor found: CreateDirectory and SetCurrentDirectory disagree on long paths). If you want, I can split that out so the residue discussion does not bury it.
Activity
caomengxuan666 commentedon Oct 17, 2026
One more from the same family as this issue, and it is a script's own positional parameters rather than a native child's:
$1niu argv.sh /c/…C:\…niu argv.sh C:/…C:/…bash argv.sh /mnt/c/…/mnt/c/…The translation is consistent with the documented rule ("every other child … always receives native Windows paths" — the child here being
niure-invoking itself), so this may be intended. Filing it against the path model because the recipient is the shell's own$1..$n, where a script author expects what they typed. It is also how I lost a whole probe run: a script that didcd "$1"followed by relative file work landed in a different place than the caller intended, with no diagnostic.If it is intended, the path contract could say so explicitly for the script-argument case (as it already does for native children), since scripts are the one place a user is most likely to assume verbatim.
Environment: Niubash 1.4.0 (
rubashgite785c3c8f610), Windows 10 x64 (build 19045); GNU bash 5.3.0 via WSL; arguments passed to a plain.shfile run as a script.caomengxuan666 commentedon Oct 17, 2026
Duplicate-sweep note: this is residue of the closed path family #329 / #331 / #592 / #537 / #566 / #224
Sweeping the tracker for closed predecessors: the path-model half of this issue belongs to a family that has already been closed six times from six entry points —
D:/drive form; self-produced path values unify to POSIXPWDdrive form makesnvm_find_upspincd /c(bare drive-root POSIX form) ENOENT when root is configured$0/BASH_SOURCErewritten for a script invoked by an absolute/d/pathEach closed fix covered its entry point; this issue reports the same contract failing from
cd ~(startup vs currentHOME) and fromcdinto a >260-char path. That is residue of the family, not a seventh independent bug.The ~260-char
mkdir-succeeds-but-cd-fails item does look new (no closed predecessor found:CreateDirectoryandSetCurrentDirectorydisagree on long paths). If you want, I can split that out so the residue discussion does not bury it.fix(tilde,cd,pushd): one HOME baseline per operation — GNU missing-vs…
docs: changelog unreleased entry for #754
fix(tilde,cd,pushd): one HOME baseline per operation — GNU missing-vs…
docs: changelog unreleased entry for #754
caomengxuan666 commentedon Oct 18, 2026
由 #819 修复落地(合并):HOME 基准统一为 GNU 活 cell 语义(空值=真值、缺失才回退)、裸 cd/pushd/popd 空词规则、comsub 快路委托内建消除漂移、20+8 用例 GNU 差分全对齐。CR 两轮(第二轮 APPROVE-WITH-NITS)。法证疑点(安装位 vs 源码构建行为不符)移交 #827(P1 发行完整性)跟踪。相邻新发现(popd 默认弹出不 chdir)另立 #830。
caomengxuan666 commentedon Oct 23, 2026
在装的 1.4.4(
rubash git fa64d58dfb9c,2026-10-22 构建,已包含 ce6e16d / PR #819)上,这条的两条都仍可复现。1.
cd ~仍用启动时的 HOME,而裸cd用当前$HOMEGNU bash 两行都给
…/newhome。修完之后裸cd对了、cd ~还是旧基线 —— 同一操作内两个 HOME 基线并存。2.
cd拒绝长路径,而同路径的[ -d ]/ 写入 /cat/ls都正常(边界已收敛到 258/259)实测:
即阈值正好落在 MAX_PATH(258 通过、259 起失败),而其余路径操作走长路径通道、269 也能读写。
上游状态
本机 D:/repo/rubash HEAD(ef271973)比安装构建新 230 个提交;
git log fa64d58dfb9c..HEAD --grep=HOME|tilde|cd只命中dirs的~缩写显示与 rc 加载,没有触碰cd长度检查或 HOME 基线的提交,所以两条都不是「已修未发布」。