From fc0a3f241f4a02c56350507448fe4ebcda89caca Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Thu, 7 May 2026 22:54:54 -0700 Subject: [PATCH] fix(mobile): silence no-control-regex on bracketed-paste sanitizer (#1580) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- mobile/app/h/[hostId]/session/[worktreeId].tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/mobile/app/h/[hostId]/session/[worktreeId].tsx b/mobile/app/h/[hostId]/session/[worktreeId].tsx index 8b4d2291a61..eddbc43f42a 100644 --- a/mobile/app/h/[hostId]/session/[worktreeId].tsx +++ b/mobile/app/h/[hostId]/session/[worktreeId].tsx @@ -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