Skip to content

fix: resolve BashKit parsing and filesystem bugs#30

Merged
chaliy merged 2 commits intomainfrom
claude/fix-bashkit-bugs-0fVX1
Feb 1, 2026
Merged

fix: resolve BashKit parsing and filesystem bugs#30
chaliy merged 2 commits intomainfrom
claude/fix-bashkit-bugs-0fVX1

Conversation

@chaliy
Copy link
Contributor

@chaliy chaliy commented Feb 1, 2026

Summary

  • Fix echo done bug: Remove terminating word check in argument position. Reserved words like done, fi, then are now only special in command position. The termination of compound commands is handled by parse_compound_list_until which checks for terminators BEFORE parsing.
  • Fix /dev/null redirect: Add /dev directory and /dev/null special handling. Writes to /dev/null are now silently discarded.
  • Add comprehensive tests for both fixes including negative/edge cases.

Test plan

  • cargo test - all 277 tests pass
  • cargo clippy - no warnings
  • cargo fmt --check - properly formatted
  • Negative tests verify reserved words still work as keywords
  • Edge case tests verify /dev/null in various contexts

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

1. Fix echo done bug: Remove terminating word check in argument position.
   Reserved words like 'done', 'fi', etc. are now only special in command
   position. The termination of compound commands is handled by
   parse_compound_list_until which checks for terminators BEFORE parsing.

2. Fix /dev/null redirect: Add /dev directory and /dev/null special handling.
   Writes to /dev/null are now silently discarded, matching expected behavior.

3. Add tests for echo done, /dev/null redirect, and string concatenation.

https://claude.ai/code/session_01Ww87yff3HEPz1GsJKCX4nQ
Add tests to verify that fixes don't break valid behavior:

Reserved word handling:
- test_done_still_terminates_loop: "done" terminates loops correctly
- test_fi_still_terminates_if: "fi" terminates if statements correctly
- test_echo_fi_as_argument: "fi" works as an argument
- test_echo_then_as_argument: "then" works as an argument
- test_reserved_words_in_quotes_are_arguments: quoted reserved words
- test_nested_loops_done_keyword: nested loops match done correctly

/dev/null handling:
- test_dev_null_read_returns_empty: reading returns empty
- test_dev_null_append: append mode works
- test_dev_null_in_pipeline: works in pipelines
- test_dev_null_exists: file exists and is readable

https://claude.ai/code/session_01Ww87yff3HEPz1GsJKCX4nQ
@chaliy chaliy force-pushed the claude/fix-bashkit-bugs-0fVX1 branch from 5d5fadf to 69de1d8 Compare February 1, 2026 18:49
@chaliy chaliy merged commit 7ae6807 into main Feb 1, 2026
4 checks passed
@chaliy chaliy deleted the claude/fix-bashkit-bugs-0fVX1 branch February 1, 2026 18:54
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