Expand description
Zsh and other advanced shell expansion checks.
BashTool may be invoked through the user’s default shell (often zsh). These checks reject constructs that bash treats literally but zsh expands.
Functions§
- has_
backslash_ whitespace - True if the command contains backslash immediately before whitespace.
Bash treats
\as a literal escaped space, but tree-sitter returns the raw text with the backslash present. We conservatively reject these cases. - has_
control_ chars - True if the command contains ASCII control characters other than tab/newline.
- has_
invisible_ whitespace - True if the command contains invisible unicode whitespace characters that could hide malicious constructs from reviewers.
- has_
zsh_ equals_ expansion - True if the command contains zsh equals expansion (
=cmdat word start). - has_
zsh_ tilde_ bracket - True if the command contains zsh
~[name]dynamic named directory expansion.