GNU bug report logs - #71081
30.0.50; shell-command-on-region outputs boilerplate text on Windows

Previous Next

Package: emacs;

Reported by: Ihor Radchenko <yantar92 <at> posteo.net>

Date: Mon, 20 May 2024 18:34:01 UTC

Severity: normal

Tags: notabug

Found in version 30.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ihor Radchenko <yantar92 <at> posteo.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: dmitry <at> gutov.dev, 71081 <at> debbugs.gnu.org, matt <at> excalamus.com
Subject: bug#71081: 30.0.50; shell-command-on-region outputs boilerplate text on Windows
Date: Thu, 23 May 2024 14:36:22 +0000
Eli Zaretskii <eliz <at> gnu.org> writes:

>> Should it be documented in the docstring of `shell-command-to-string'?
>
> We could, but IMO such tangential information belongs to the manual,
> not to the doc string.  We should also somehow avoid the slippery
> slope of describing all the differences between the Posix shells and
> the Windows shell.  E.g., newlines are also not allowed in Windows
> file names, but we don't mention that in doc strings of every function
> that deals with file names.

Understood.

>> Why would anyone assume that `shell-command-to-string' is
>> passed as an argument to cmd.exe and not piped as input?
>
> Because the doc string says so:
>
>   Execute shell command COMMAND and return its output as a string.
>
> "Execute COMMAND" means run it as "SHELL -c COMMAND", in any
> reasonable interpretation.  Anything else is not the usual way of
> running commands.

Another reasonable interpretation is: "do the same thing as if I type
COMMAND into shell prompt". But that's me. If you think that my
interpretation is uncommon, so be it.

>> more over, on Linux, different shells have different behaviors wrt
>> input/command argument/script file).
>
> Same on Windows.  Try PowerShell some day.  Does it mean we need to
> document all of that in our documentation?

It would be nice, yes. Without details - just point that there is a
difference. Maybe in the "41.3 Creating a Synchronous Process" section
of the manual.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




This bug report was last modified 1 year and 53 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.