Skip to content

Commit 7ba7831

Browse files
committed
🤖 fix: correctly expand ~\/ in SSH resolvePath
Bash tilde expansion can occur inside parameter-expansion patterns; use an escaped tilde (\~) in so ~/path expands to /root/path correctly.
1 parent 8f39f5e commit 7ba7831

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/node/runtime/SSHRuntime.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,8 @@ export class SSHRuntime extends RemoteRuntime {
298298
`p=${shescape.quote(filePath)}`,
299299
'if [ "$p" = "~" ]; then',
300300
' echo "$HOME"',
301-
'elif [ "${p#~/}" != "$p" ]; then',
302-
' echo "$HOME/${p#~/}"',
301+
'elif [ "${p#\\~/}" != "$p" ]; then',
302+
' echo "$HOME/${p#\\~/}"',
303303
'elif [ "${p#/}" != "$p" ]; then',
304304
' echo "$p"',
305305
"else",

0 commit comments

Comments
 (0)