You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Split an Operator After an Escaped Backslash the Way Bash Does #2313
The guard's tokenizer in host-setup/agent-safety/claude/gh-write-guard.py reads an escaped backslash followed by an operator as one word, so a shell wrapper glued to that operator is never seen as a command. Constructed example, allowed although bash runs the loop with no bound:
timeout 900 true\;bash -c 'while true; do sleep 1; done'
Bash reads \\ as a literal backslash argument to true and the ; as a real separator, so bash -c runs on its own. The tokenizer yields a single ;bash token instead, and the wait-loop check never reaches the wrapper. It may share a cause with #1959, which covers shlex pairing quotes differently from bash, but this shape holds no quote.
Done looks like
The tokenizer splits an unescaped operator after an escaped backslash the way bash does, or the check reads such a token as no bound, with a self-test row for the shape above.
Found by a local strict review pass on #2117. It predates that pull request.
Closed: Folded into #1959 per #2517, approved by the maintainer. This is a case of the guard's lexer splitting a command differently from bash, and #1959's single bash-aware scanner fixes the class, with this shape kept as a self-test row there.
Activity
ptr727 commentedon Oct 8, 2026
Closed: Folded into #1959 per #2517, approved by the maintainer. This is a case of the guard's lexer splitting a command differently from bash, and #1959's single bash-aware scanner fixes the class, with this shape kept as a self-test row there.