fix(mobile): silence no-control-regex on bracketed-paste sanitizer (#1580)

The regex /\x1b\[20[01]~/g intentionally matches control characters —
that's the entire point of the sanitizer (stripping embedded \x1b[200~ /
\x1b[201~ markers from clipboard text). Suppress the lint warning with
the same convention used elsewhere in mobile/ (see scripts/repro-worktree-startup-stream.ts).

Comment-only change, zero runtime impact. Follows up #1576.

Co-authored-by: hermes <hermes@stably.ai>
This commit is contained in:
Neil
2026-05-07 22:54:54 -07:00
committed by GitHub
co-authored by hermes
parent 52cc6d5f97
commit fc0a3f241f
@@ -1013,6 +1013,7 @@ export default function SessionScreen() {
// malicious copy containing `\x1b[201~` can't terminate paste mode early
// and have the trailing bytes interpreted as shell commands. Matches
// xterm.js / iTerm2 behavior.
// eslint-disable-next-line no-control-regex -- intentional bracketed-paste marker stripping
const sanitized = wrap ? text.replace(/\x1b\[20[01]~/g, '') : text
const payload = wrap ? `\x1b[200~${sanitized}\x1b[201~` : sanitized
const wrappedBytes = new TextEncoder().encode(payload).byteLength