docs(ssh): note why the exec-failure head regex may match lazily

This commit is contained in:
Neil
2026-09-04 23:33:41 -07:00
parent 17b10106d5
commit 181a3eaf7d
+5 -1
View File
@@ -89,5 +89,9 @@ export function localNodeHeadersFromOutput(output: string): string | null | unde
return undefined
}
/** `Command "<anything, quotes included>" failed (exit N): ` -- see ssh-relay-exec-command.ts. */
/**
* `Command "<anything, quotes included>" failed (exit N): ` -- see ssh-relay-exec-command.ts.
* Lazy `[\s\S]*?` is safe: it stops at the first `" failed (exit N): `, and no command this
* module builds contains that literal, so the match cannot end early inside the command.
*/
const EXEC_FAILURE_HEAD_RE = /^Command "[\s\S]*?" failed \(exit -?\d+\): /