Skip to content

fix: preserve literal empty double-quoted arguments - #320

Open
ikenyal wants to merge 1 commit into
strands-agents:mainfrom
ikenyal:fix/preserve-empty-double-quoted-arguments
Open

ikenyal wants to merge 1 commit into
strands-agents:mainfrom
ikenyal:fix/preserve-empty-double-quoted-arguments

Conversation

@ikenyal

@ikenyal ikenyal commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Description

A literal empty double-quoted word never marked its expansion as a quoted field, so f "" x lost the empty argument. Preserve that field without changing the zero-argument expansion of "$@".

Expand the existing Bash comparison case to check argument counts and values, adjacent quotes, empty variables, and forwarding. The fix also makes the existing empty case pattern match Bash, so both resolved known-difference markers are removed.

Related Issues

Fixes #299

Documentation PR

Not needed; this restores existing behavior.

Type of Change

Bug fix

Testing

  • I ran the relevant test suites for the bindings I touched (cargo test --workspace --all-targets, pytest tests/python, npm test)
  • If I touched Rust, I ran cargo fmt and cargo clippy

Validated on macOS against main after #315 with the full Rust check, workspace doctests, and Node-feature Rust unit tests. Both changes also passed direct CLI checks during initial validation. Existing lint warnings remain.

Checklist

  • I have read the CONTRIBUTING document
  • I have reviewed and understand every line of code in this PR, including any generated by AI tools, and I can explain why it works
  • My change is focused and reasonably small; I have split unrelated work into separate PRs
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Documentation changes are not needed: this restores existing shell behavior.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@github-actions github-actions Bot added the bug Something isn't working label Nov 18, 2026
@ikenyal
ikenyal marked this pull request as ready for review November 18, 2026 23:03

This branch has not been deployed

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] A double-quoted empty word ("") is dropped from a command's arguments

1 participant