From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.bugs Subject: bug#71081: 30.0.50; shell-command-on-region outputs boilerplate text on Windows Date: Wed, 22 May 2024 11:45:23 +0000 Message-ID: <87le42jcj0.fsf@localhost> References: <875xv8qqlv.fsf@localhost> <86y1848g3a.fsf@gnu.org> <863fc61b-5ad5-47e5-9f95-96cdcfcfd016@gutov.dev> <8634qa8tp0.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23959"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Dmitry Gutov , 71081@debbugs.gnu.org, matt@excalamus.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 22 13:44:13 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s9kOC-000610-N7 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 22 May 2024 13:44:12 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s9kNy-000086-9X; Wed, 22 May 2024 07:43:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s9kNw-000078-LB for bug-gnu-emacs@gnu.org; Wed, 22 May 2024 07:43:56 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s9kNw-0004lb-3U for bug-gnu-emacs@gnu.org; Wed, 22 May 2024 07:43:56 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s9kO1-0001eo-Qe for bug-gnu-emacs@gnu.org; Wed, 22 May 2024 07:44:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ihor Radchenko Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 22 May 2024 11:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71081 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug Original-Received: via spool by 71081-submit@debbugs.gnu.org id=B71081.17163782356357 (code B ref 71081); Wed, 22 May 2024 11:44:01 +0000 Original-Received: (at 71081) by debbugs.gnu.org; 22 May 2024 11:43:55 +0000 Original-Received: from localhost ([127.0.0.1]:55440 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s9kNu-0001eT-VO for submit@debbugs.gnu.org; Wed, 22 May 2024 07:43:55 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:53601) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s9kNs-0001eN-Le for 71081@debbugs.gnu.org; Wed, 22 May 2024 07:43:53 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id A7C1B240104 for <71081@debbugs.gnu.org>; Wed, 22 May 2024 13:43:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1716378220; bh=N63Kh0+pCXfd4rw8h2W64KymfhZyprklYdVUanEBeiI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=esM91B4i0PU0VCWAILp46orPHd2HqUN6omVWyGiJzT72Tmny24hhnZ9AFqobVJNlb pmOQhV3F6hQWm+dF6fcZw1w46zXujeM0aK9c52jZR3mbDgidFIq/UOUp5688PKV0W0 kPiERUGlueerk6GCz7GAWLdN5AGdSlWfolQp881B1CYeBljqjTQCSMns4XxllLbv63 CmC+akdc0YVqkvqxdyICkv1X18rB/Cgiikk92S42umlPJs7S9Gks7VUYB61PPerOAw 7sxdPqTspNSmg0GIdvpSibqR6Ja/Ain2mwW5yDk3tb8BPJiz+1Oz9zWSqd2s9GWu9p pVkp1hVUta1DQ== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VkqFR2kDbz9rxD; Wed, 22 May 2024 13:43:39 +0200 (CEST) In-Reply-To: <8634qa8tp0.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:285601 Archived-At: Eli Zaretskii writes: >> On 20/05/2024 21:59, Eli Zaretskii wrote: >> > If it expects the same behavior from cmd.exe as a Posix >> > shell would produce, the expectation is simply incorrect and >> > unjustified. >> >> Perhaps we should run something different, or with different arguments, >> when on Windows? > > Maybe. But as I said, I don't have a clear understanding of the > issue. If I did, perhaps I could give some advice or even suggest a > code change if required. The goal is to evaluate a shell script - multi-line string. For example, given "cd foo pwd" we need to get the output/value separated from the stderr and stderr output. Org mode uses the approach borrowed from `shell-command-on-region' - passing the script as input to shell process (we use `process-file'). However, as demonstrated by my reproducer, this approach generates more than just script output. In theory, we might pass the script as -c '', but that's not all the story. We also sometimes want to pass the script in chunks (via comint interaction). When using comint, piping commands to shell process input is the only way to keep the shell running as we send it more commands. However, the same problem persists - when sending the very first command, cmd.exe generates its version data, which we cannot easily distinguish from the rest of the output. We cannot easily see stderr either. P.S. CCing Matt, ob-shell maintainer. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at