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
builtins/expansion: printf numeric validation, command -v multi-operand status, ~+/~-/~user in assignments, type -a ordering, BASH_ARGC/HISTCMD #704
P2-medium中:次要缺陷或边缘路径,排期修复area:builtinsbuiltin semantics (printf/declare/command/type/...)bugSomething isn't workingfamily:S1taxonomy S1: word-level fast path reimplements lexer semantics in text
Leading whitespace (' 5') matches on both (accepted).
Trailing tab / newline also affected.
For %f the value is dropped to 0.000000 instead of kept.
R6.2 command -v with multiple operands: exit status uses "all found" instead of "any found"
$ command -v echo nosuch_xyz >/dev/null ;echo$?
niu : 1
bash: 0 # bash returns 0 if ANY operand is found
Exhaustive: missing+found in any position → niu 1, bash 0; all missing → both 1; all found → both 0. type agrees between shells, so this is specific to command -v.
R6.3 Tilde expansion in assignment context: ~+, ~-, ~user not expanded
Only the ~+ / ~- / ~user prefixes fail, and only in assignment position. (~user also has no passwd db on Windows — but ~+/~- need no db and still fail.)
R6.4 type -a ordering disagrees with actual resolution (Windows PATHEXT)
With a PATH directory containing both extensionless tool and tool.bat:
$ type -a tool # niu: lists .../tool FIRST, then .../tool.bat
$ command -v tool # niu: .../tool.bat
$ tool # niu: runs tool.bat
type -a reports the extensionless file first while command -v and execution both pick tool.bat — internally inconsistent. On GNU/Linux type -a correctly lists only the extensionless file. (niu can run extensionless files when they are the only match, so type -a is actively misleading here, not merely extra.)
Version note (correction to the Method line): the oracle was reached with bare wsl.exe -e bash, which resolves through PATH to /usr/local/bin/bash = GNU bash 5.3.0(1) — not 5.2.21. The 5.2.21 build lives at /bin/bash, and every item in this report was re-checked on it as well; results were identical on both.
So the two versions are listed in the wrong order above: 5.3.0 was the default, 5.2.21 the cross-check.
No finding here changes; noting it only so the numbers reproduce. (Incidentally 5.3.0 is also the oracle cited in rubash#641, "the repository oracle is WSL 5.3.0".)
Both predecessors are closed, and the expansion still fails from a third position (an assignment RHS). Same shape as the other families in the sweep: the item gets closed at the reported entry point, and the class stays open at the others. Worth treating as one "tilde expansion positions" family (word → assignment → completion) rather than three separate fixes.
Not a duplicate claim — this issue stays open. Flagging it so triage can decide whether to re-open #550 or fold the position sweep into it.
P2-medium中:次要缺陷或边缘路径,排期修复area:builtinsbuiltin semantics (printf/declare/command/type/...)bugSomething isn't workingfamily:S1taxonomy S1: word-level fast path reimplements lexer semantics in text
Activity
caomengxuan666 commentedon Oct 17, 2026
Version note (correction to the Method line): the oracle was reached with bare
wsl.exe -e bash, which resolves through PATH to/usr/local/bin/bash= GNU bash 5.3.0(1) — not 5.2.21. The 5.2.21 build lives at/bin/bash, and every item in this report was re-checked on it as well; results were identical on both.So the two versions are listed in the wrong order above: 5.3.0 was the default, 5.2.21 the cross-check.
No finding here changes; noting it only so the numbers reproduce. (Incidentally 5.3.0 is also the oracle cited in rubash#641, "the repository oracle is WSL 5.3.0".)
caomengxuan666 commentedon Oct 17, 2026
Duplicate-sweep note: the
~item here is a residue of closed issues, not a new classI swept the tracker for closed predecessors of everything I filed, and this one's second item is not new:
~+/~-/~userin an assignment (x=~root,x=~+)echo ~root:xnot expanded in a command word (closed 2026-10-12, labelled platform)"~/"handlingcompgen -d -- "~/"quoted tilde-slash not expanded (closed 2026-10-12)Both predecessors are closed, and the expansion still fails from a third position (an assignment RHS). Same shape as the other families in the sweep: the item gets closed at the reported entry point, and the class stays open at the others. Worth treating as one "tilde expansion positions" family (word → assignment → completion) rather than three separate fixes.
Not a duplicate claim — this issue stays open. Flagging it so triage can decide whether to re-open #550 or fold the position sweep into it.
fix(builtins): command -v any-found status, dirs -l separator (#704 R…
caomengxuan666 commentedon Oct 17, 2026
先修了 R6.2,提交
5da6421。R6.2
command -v多操作数 —— 已修根因不在
builtins/command.rs(那里的any_found逻辑本来是对的),而在executor/type_builtin.rs的execute_command_describe_with_io:它和type共用了一个"任一缺失就置 1"的累加器。command的-v/-V走这条路径,type不走。GNU
builtins/command.def是 any-found(if (describe_command (...) == 0) any_found++),type是 all-found。现在command这条改成any_found,-V的逐操作数 "not found" 诊断保留。command -v echo nosuch_xyzcommand -v nosuch_xyz echocommand -V echo nosuch_xyzcommand -v nosuch1 nosuch2type echo nosuch_xyz(对照)回归测试
command_describe_multi_operand_uses_any_found。剩余四项未动
printf尾随空白当合法数字:需要改%d %i %x %o %u的转换校验和%f的取值路径,涉及面比"加个 trim 判断"大(%f现在还会把值丢成0.000000),单独一轮做。~+/~-/~user:tilde 展开在赋值位走的是另一条入口,要单独接。type -a的 PATHEXT 顺序:这是 Windows 路径解析与command -v不一致,属路径层。BASH_ARGC/HISTCMD:需要看 frame stack 和交互历史是否具备前置条件。issue 先留着。
Merge pull request #869 from unixwin/fix/704