mirror of
https://github.com/stablyai/orca.git
synced 2026-09-22 08:02:28 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user