Closed graywolf closed 3 months ago
Hello!
Yes, currently open-remote-pipe*
literally does this:
(open-remote-pipe session (string-join (cons prog args)) mode)
It's not clear for me what do you expect from the procedure. Could you please share your workaround? Maybe that way I can better understand how to fix the documentation (or the procedure itself, for that matter.)
Thanks, -avp
Hi :)
It's not clear for me what do you expect from the procedure. Could you please share your workaround?
Sure, I would have expected (open-remote-pipe* "ls" "-la" "/foo bar")
to list details about a file /foo bar
, the same way local (open-pipe* "ls" "-la" "/foo bar")
would.
My workaround is:
(define (shell-quote s)
"Quote string S for sh-compatible shells."
(string-append "'" (string-replace-substring s "'" "'\\''") "'"))
(apply open-remote-pipe* session OPEN_BOTH
(shell-quote prog) (map shell-quote args))
That seems to do what I need, as long as there is POSIX-compatible shell on the other end.
Hello!
I pushed changes that address this issue as 7a6c86fb4597abd03f96f32ca1fc07a16e6831b7
Please check if it works for you.
Thanks, -avp
Can confirm the commit does work, thank you :)
The documentation claims
However what is actually executed is the equivalent of
(string-append prog " " (string-join args " "))
. That is quite surprising, given the signature of the procedure, so I believe it should be documented.Working around it (and getting actual equivalent of
open-pipe*
) is not hard, but one has to know it is necessary and I find that somewhat hard to figure out from the current documentation.