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: Eli Zaretskii <eliz <at> gnu.org>
To: Ihor Radchenko <yantar92 <at> posteo.net>
Cc: 71081 <at> debbugs.gnu.org
Subject: bug#71081: 30.0.50; shell-command-on-region outputs boilerplate text on Windows
Date: Mon, 20 May 2024 21:59:21 +0300
tags 71081 notabug
thanks

> From: Ihor Radchenko <yantar92 <at> posteo.net>
> Date: Mon, 20 May 2024 18:34:52 +0000
> 
> Hello,
> 
> On Linux, if I put
> 
> echo foo
> 
> into scratch, select it, and run M-x shell-command-on-region sh,
> I get "foo" in echo area.
> 
> However, on Windows, the result of M-x shell-command-on-region cmdproxy is
> 
> Microsoft Windows [Version 10.0.19045.2251]
> (c) Microsoft Corporation. All rights reserved.
> 
> c:\Users\johndoe\Org>echo foo
> foo
> 
> I expected just "foo".
> 
> Original bug report:
> https://list.orgmode.org/orgmode/CACjq+cy8G+EkMgSwr5KWNbN7jjLE3tzqKwbQiTy84ZvJsumMwQ <at> mail.gmail.com/
> 
> AFAIU, the culprit is how cmdproxy handles piped input:
> 
> cmdproxy -c 'echo foo' works fine, outputting "foo".
> However (in powershell) echo 'echo foo' | cmdproxy yields the above
> verbose text - all in stdout.

It is not cmdproxy that does this, it's cmd.exe.  cmdproxy is not a
shell, it's a simply proxy of the shell that is there to fix some
obscure problems (such as some quoting issues).  To run shell
commands, it eventually invokes cmd.exe.  Try

   echo echo foo | cmd

and you will see the same behavior.

Conclusion: Windows is not a Posix system.  But you already knew
that...

As for the original bug report: AFAIR, when cmd.exe says "More?", it
needs a final newline.  Other than that, I don't really understand
what is the problem that bug report is trying to solve (I don't use
org-babel).  If it expects the same behavior from cmd.exe as a Posix
shell would produce, the expectation is simply incorrect and
unjustified.

I see no Emacs bug here.




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.