Skip to content

Commit 49873ed

Browse files
committed
fix: use expandTildeForSSH for proper path quoting in SSH terminals
This completes the SSH terminal improvements by using expandTildeForSSH for proper $HOME expansion and path quoting instead of single-quote escaping. Generated with `mux`
1 parent 0de5853 commit 49873ed

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/node/services/ipcMain.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1742,9 +1742,9 @@ export class IpcMain {
17421742
// Add host
17431743
sshArgs.push(config.sshConfig.host);
17441744
// Add remote command to cd into directory and start shell
1745-
// Use single quotes to prevent local shell expansion
1746-
// exec $SHELL replaces the SSH process with the shell, avoiding nested processes
1747-
sshArgs.push(`cd '${config.remotePath.replace(/'/g, "'\\''")}' && exec $SHELL`);
1745+
// expandTildeForSSH handles proper quoting and $HOME expansion
1746+
const expandedPath = expandTildeForSSH(config.remotePath);
1747+
sshArgs.push(`cd ${expandedPath} && exec $SHELL -i`);
17481748
}
17491749

17501750
const logPrefix = isSSH ? "SSH terminal" : "terminal";

0 commit comments

Comments
 (0)