Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/main/services/ssh/SshService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,9 @@ export class SshService extends EventEmitter {
// Build the command with optional cwd, wrapped in a login shell so that
// ~/.ssh/config, ~/.gitconfig, and other user-level configuration files
// are available (ssh2's client.exec() uses a non-login shell by default).
const innerCommand = cwd ? `cd ${quoteShellArg(cwd)} && ${command}` : command;
const safeCwd = cwd ? cwd.replace(/\\/g, '/').replace(/"/g, '\\"') : undefined;
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
const innerCommand = safeCwd ? `cd ${quoteShellArg(safeCwd)} && ${command}` : command;
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated

const fullCommand = `bash -l -c ${quoteShellArg(innerCommand)}`;

return new Promise((resolve, reject) => {
Expand Down
Loading