Skip to content

Comments

feat(bash): auto-populate shell variables (PWD, HOME, USER, etc.)#252

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

feat(bash): auto-populate shell variables (PWD, HOME, USER, etc.)#252
chaliy merged 1 commit intomainfrom
claude/bashkit-bash-compatibility-BsDKD

Conversation

@chaliy
Copy link
Contributor

@chaliy chaliy commented Feb 24, 2026

Summary

  • Initialize shell variables at startup: HOME, USER, UID, EUID from configured username
  • Add HOSTNAME, BASH_VERSINFO array
  • Add dynamic expansion for PWD (from cwd), BASH_VERSION, SECONDS, HOSTNAME, OLDPWD
  • cd builtin now sets OLDPWD on directory change
  • Builder env() calls also set shell variables so they override defaults

Test plan

  • cargo test --all-features passes (all 1020+ unit tests)
  • cargo clippy clean
  • cargo fmt --check clean
  • bash_comparison_tests 789/789 match real bash
  • 10 new spec tests for shell variable auto-population
  • All 874 bash spec tests pass

…CONDS

Initialize shell variables at startup: HOME, USER, UID, EUID from
configured username (default: sandbox), HOSTNAME from configured value,
BASH_VERSINFO array. Add dynamic expansion for PWD (from cwd),
BASH_VERSION, SECONDS, HOSTNAME, OLDPWD.

cd builtin now sets OLDPWD on directory change and reads HOME from
variables. Builder env() calls also set shell variables so they
override defaults.

10 spec tests covering PWD, HOME, USER, HOSTNAME, BASH_VERSION,
BASH_VERSINFO, UID, SECONDS, cd updates.
@chaliy chaliy merged commit 3d7c78d into main Feb 24, 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