Subject: bug#54487: 29.0.50; connection-local value for `shell-file-name' not set in Dired buffers over Tramp

From: Eli Zaretskii <[email-masked]>
Date: Mon, 21 Mar 2022 14:40:39 +0200

> From: Michael Albinus <[email-masked]>
> Date: Mon, 21 Mar 2022 11:25:28 +0100
> Cc: [email-masked]
> 
> The problem is rather quoting the arguments with shell-quote-argument. It
> applies the quoting according to the value of system-type. If this is
> 'ms-dos or 'windows-nt, MS Windows quoting rules are applied.
> 
> The appended patch fixes this for me, could you pls check?

Is it really a good idea to solve this only for Grep?  Shouldn't shell
quoting always use this logic (with some variable that callers could
bind in exceptional cases, which I presume will be rare)?  Or am I
missing something?