You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's a limitation coming from the way things work, cannot help much in this regard without complicating things a lot.
One alternative in this situation would be to spawn a shell, execute this command in there, and then print pwd. Try running (with exec) 'bash', ['-c', 'cd ~/server/bin', 'pwd'] and tell me if that works
In v14, a cwd that starts with ~/ (or is just ~) is relative to the remote user's home directory: node-ssh leaves the ~ unquoted so the shell expands it, and still quotes the rest. Until then, use an absolute path, or $HOME with execCommand('cd ~/server/bin && pwd').
Activity
steelbrain commentedon Sep 14, 2022
It's a limitation coming from the way things work, cannot help much in this regard without complicating things a lot.
One alternative in this situation would be to spawn a shell, execute this command in there, and then print pwd. Try running (with exec)
'bash', ['-c', 'cd ~/server/bin', 'pwd']and tell me if that workssteelbrain commentedon Nov 16, 2026
In v14, a
cwdthat starts with~/(or is just~) is relative to the remote user's home directory: node-ssh leaves the~unquoted so the shell expands it, and still quotes the rest. Until then, use an absolute path, or$HOMEwithexecCommand('cd ~/server/bin && pwd').Fix isConnected, Buffer keys, ~ in cwd and declaration imports