Skip to content

pushd 边角两分歧(#889 CR 记录):pushd -- -n GNU cd 失败 rc 1 vs rubash usage rc 2;pushd - 疑似同族 #896

Closed

Description

@caomengxuan666

来源:PR #889(#859 pushd -n 静默 no-op)CR 轮越界观察。

  1. pushd -- -n:GNU rc 1(-- 后操作数走 cd 失败语义),rubash usage 错误 rc 2——-- 后操作数应进 cd 路径而非 usage。
  2. pushd -:疑似同族分歧(CR 未深挖,先立票记录)。

验收

WSL GNU 5.3.0(1) 双侧逐字节(两形 + 与 #859/#855 修复形的组合);pushd 家族回归不回退。

Activity

  1. arookieofc commented on Oct 19, 2026

    @arookieofc
    Member

    Fixed by #901.

    Root cause (GNU C source, third_party/bash 5.3 p15): leading -- sets skipopt and skips the walk (pushd.def:183-190); lone - breaks the walk as a Dir operand (pushd.def:223-225) routed through cd - (cd.def:339-349); option-only lists are silent success (pushd.def:288); multi-word Dir is too many arguments rc 1 via CD_COMPLAINS (cd.def:326-330).

    pushd -- -n is now pushd: -n: No such file rc 1 (was usage rc 2); pushd - echoes $OLDPWD + stack rc 0; pushd -n/-n -- alone are silent rc 0 (no longer swap); extras on the cd path are too many arguments rc 1 with no usage line. Full matrix verified byte-identical vs WSL GNU bash 5.3.0; new tests/issue896 (9 tests).

    Note: pushd +1 -n (should be silent NOCD rotation) and pushd +1 +9 (should be inline range error) remain pre-existing divergences in the same walk - left for a follow-up, documented in the commit/PR.

  2. added a commit that references this issue on Oct 19, 2026
  3. arookieofc commented on Oct 19, 2026

    @arookieofc
    Member

    CI 全绿:PR #901 的 5 项检查(Rust tests、macOS、GNU regression goldens、cross-target、shell functionality)全部 pass。合并 origin/master(PR #889 的 #859 NoOp)后的冲突已解决:保留 #896 的完整 dash-family option walk,拼写统一为已合入的 NoOp。WSL GNU 5.3.15 双侧逐字节对照一致(仅 tmpdir/路径显示等环境 artifact 除外)。待合入。

  4. added a commit that references this issue on Oct 20, 2026
    62a30ab
  5. arookieofc commented on Oct 20, 2026

    @arookieofc
    Member

    Close-out: fixed on master via #901 (commit 62a30ab, merged after rebase over #889). dash-family option walk now follows GNU pushd.def: leading -- sets skipopt, lone - routes through cd -, option-only lists are silent success. Master CI green (Rust/macOS/cross-target/shell-functionality/goldens). No separate local re-verification run from me on this one - the PR's own WSL 5.3.15 byte comparison plus master CI cover it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions