From 181a3eaf7d49a74ce009fd2fd2f111b1b4a99ace Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Fri, 4 Sep 2026 23:33:41 -0700 Subject: [PATCH] docs(ssh): note why the exec-failure head regex may match lazily --- src/main/ssh/ssh-relay-node-headers.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/ssh/ssh-relay-node-headers.ts b/src/main/ssh/ssh-relay-node-headers.ts index a441112a923..a590bd40fca 100644 --- a/src/main/ssh/ssh-relay-node-headers.ts +++ b/src/main/ssh/ssh-relay-node-headers.ts @@ -89,5 +89,9 @@ export function localNodeHeadersFromOutput(output: string): string | null | unde return undefined } -/** `Command "" failed (exit N): ` -- see ssh-relay-exec-command.ts. */ +/** + * `Command "" 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+\): /