Luck 077773a967
fix(sandbox): match local grep lines without their terminator (#8210)
* fix(sandbox): match local grep lines without their terminator

find_grep_matches ran the regex on each line with its trailing "\n", so
patterns that can consume the newline (\s$, [^a-z]$, \n) matched every
newline-ended line while the returned line was shown stripped. Strip the
LF or CRLF terminator before matching, as grep(1) and the remote sandbox
providers do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(sandbox): clarify local grep CRLF handling

* test(sandbox): cover literal grep line terminators

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2026-11-13 23:17:18 +08:00
..