emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master 0ad1c0d: * lisp/net/tramp.el (tramp-handle-make-process): Han


From: Stefan Monnier
Subject: Re: master 0ad1c0d: * lisp/net/tramp.el (tramp-handle-make-process): Handle shell commands.
Date: Fri, 18 Dec 2020 10:38:56 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

>>> +   ;; Quote shell command.
>>> +   (when (and (= (length command) 3)
>>> +              (stringp (nth 0 command))
>>> +              (string-match-p "sh$" (nth 0 command))
>>> +              (stringp (nth 1 command))
>>> +              (string-equal "-c" (nth 1 command))
>>> +              (stringp (nth 2 command)))
>>> +     (setcar (cddr command) (tramp-shell-quote-argument (nth 2 command))))
>>
>> This looks odd (what is special about the quoting needs of "sh -c" which
>> wouldn't apply to other commands?).  Do you have some bug# or test case
>> associated to it so we can better understand why it's needed?
>
> See the thread "Tramp and conversion of \r\n into \n" in
> emacs-devel. Martin gave me tons of Tramp traces.
>
> I'm also not so happy with this special handling, and I expect we'll
> find a better solution. I'm still working on this.

I commend you make that clear in a comment (including a reference to
the relevant thread).

BTW, what would go wrong if you did
(setq command (mapcar #'tramp-shell-quote-argument command))?


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]