Remote-ssh: connect to remote host failed

Hey, thanks for the report. This is an incredibly thorough root-cause analysis, and the debugging is genuinely impressive.

Both changes make perfect sense: anchoring the regex with ^ to avoid matching markers inside echo "..." lines, and using lastIndexOf to capture the real output instead of the contents of the echo script.

We’ve hit the exact same issue before with JumpServer bastions (see this post: Connection to Cursor server failed: Couldn't install Cursor Server, install script returned non-zero exit status), and your write-up finally clarifies the root cause.

I’m passing this along to the extensions team along with your suggested fix. There’s no release timeline yet, but the level of detail you provided should make it much easier to implement. Your temporary workaround is great.

Let me know if anything new comes up.