Skip to content

feat(builtins): implement pushd, popd, dirs#268

Merged
chaliy merged 1 commit intomainfrom
claude/bashkit-bash-compatibility-BsDKD
Feb 25, 2026
Merged

feat(builtins): implement pushd, popd, dirs#268
chaliy merged 1 commit intomainfrom
claude/bashkit-bash-compatibility-BsDKD

Conversation

@chaliy
Copy link
Contributor

@chaliy chaliy commented Feb 25, 2026

Summary

  • Add pushd builtin: push current directory onto stack, cd to target; swap top two with no args
  • Add popd builtin: pop top directory from stack and cd to it
  • Add dirs builtin: display stack with -c (clear), -p (per-line), -v (verbose/numbered)
  • Stack stored in internal _DIRSTACK_* variables
  • 100 builtins total (97 core + 3 feature-gated)

Test plan

  • cargo clippy --all-targets --all-features -- -D warnings passes
  • cargo test --all-features --test spec_tests bash_spec_tests passes
  • 12 new spec tests (Bash 993, Total 1411)
  • Error cases: empty stack, nonexistent directory, no-args-empty

Add directory stack builtins: pushd (push dir + cd), popd (pop + cd),
dirs (display stack with -c, -p, -v flags). Stack stored in internal
variables. 12 spec tests.
@chaliy chaliy merged commit 60ad9a4 into main Feb 25, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants