From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id qCBTL+FdymMPewAAbAwnHQ (envelope-from ) for ; Fri, 20 Jan 2023 10:24:49 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 0IVIL+FdymMrTgEAauVa8A (envelope-from ) for ; Fri, 20 Jan 2023 10:24:49 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 706443EE23 for ; Fri, 20 Jan 2023 10:24:49 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pIncq-0007x6-F1; Fri, 20 Jan 2023 04:23:56 -0500 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 1pIncn-0007wc-C2 for emacs-orgmode@gnu.org; Fri, 20 Jan 2023 04:23:53 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pInck-0007Xt-Uf for emacs-orgmode@gnu.org; Fri, 20 Jan 2023 04:23:53 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id AD53D24081E for ; Fri, 20 Jan 2023 10:23:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1674206628; bh=24NzE0aTSjjmK887FijJcPZOj3vjiUKDmLV5YbAqNbg=; h=From:To:Cc:Subject:Date:From; b=oimpEqh4XQz3yctSalh26mC+qGJLj/yCp66R0KTH0Ck+IP83iHrsTejF7GXknvxbp QMmv2Q37s+XLc7j5uctrcd84yAxcqpzSRDom+Uy8LKOLulxpGQgvRtLvbKF5kmVPvE +zYgNkJMo3Vyt/Jkbv7CG6iOhcXG6vXpnuv2TJfUP6lbJtU2Qk0ps1tFdCbTUssWnA wkAqIDPeEqY/jy788WYIbnEgB2NSda+4O5RoRKUQvKL7UoM/p2vLCioZV08zr+uFQU 8AMnjWQlmLVvpxsAIr3WEncVhn8wgPivSab75n9voZ0LJmmTYECH+PIywg0XS4cI9c ZOqtO3sQxPjBg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4NyvFB4fMjz6tmB; Fri, 20 Jan 2023 10:23:42 +0100 (CET) From: Ihor Radchenko To: Osher Jacob Cc: Matt , emacs-orgmode Subject: Re: [BUG] ob-shell doesn't evaluate last line on Windows (cmd/cmdproxy) [9.6.1 ( @ c:/Users/Osher/AppData/Roaming/.emacs.d/elpa/org-9.6.1/)] In-Reply-To: References: <185bc86c826.11ae860d1190626.407710511075709301@excalamus.com> <185bd43e452.bb3f5419220019.823265614059778953@excalamus.com> <185c34814a4.bcdd7b94578193.327779579906739164@excalamus.com> <87ilh48b6p.fsf@localhost> Date: Fri, 20 Jan 2023 09:24:11 +0000 Message-ID: <87edrptv7o.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1674206689; a=rsa-sha256; cv=none; b=npisMauv1pbnoSKVoEULgF0JemsCm4D0Q1/YJOBa2HY6S/LJ+f1qoAObrj1IqEITCoS7b8 IXq8uVnJSJoADrZDNkzN8fO4nTBg/gnFArzuRroMJ0fgHAr/kxlZl3Hx0W8PQDcriXXgJu 2k5/gaQcuAiIHBbEZPgQM5f1LGnFef8zq/vNwaZhC8TnFOt+IcCjOO1SgjTeDypaj800Mq c0PXXEu/uGf5vGjgPH7shKuMNuJTx+1S3Z/R8GNfkkP477Wmfw7zzgvT7tGwzyI3Xn1v42 RwA2a7NfQzewvC5Ry+zlqDcTtMEFn0qgvB1JW+euJM3ybc8Ozo97Jr1qaB2VUA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=oimpEqh4; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1674206689; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=hyH0ZbmwMNlpkYRfyI5R6KKghAHpYmsZPSVJZnGmuXo=; b=U/a5ij/S4TlsbhBZQtHMQ31C8tCBv/QnH6+INXGsqbWWLpUw1RWhzjAjbdsGJ2+9lNCQqq DrSTtTlIjjvhmBkDdXHQJqW53lbZCMax808JqI4uT475Nhramizav5TsuQVEugkal+mAUv V2sCZMRRiNvjYQcISF2oQw4qdLEQ7cDBTlWB5NEBdNcyUZGofrNozPHAXgwIeVdiBgh20+ hZ278b0Ts1i1obV4yUni5He9QJQfX3bj/frE5I17f6m8xjXHFlDGpcINCqav00A4pwsJj5 0kIVKiMBZ5A3tOkp6GSihiF/mknYHLvJIZIet+MIfgeSdI/2AMDwt7fHpg4L5A== X-Spam-Score: -6.07 X-Migadu-Queue-Id: 706443EE23 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=oimpEqh4; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -6.07 X-TUID: heP1TGkCO+rO Osher Jacob writes: > On Wed, Jan 18, 2023 at 11:05 AM Ihor Radchenko wrote: > >> If running cmdproxy.exe /c cmdproxy.exe /path/to/input is not wrong, the >> problem is on Emacs side. > > >> Osher, could you try putting your example script into a file and running >> the command line directly? What will it output? >> > > Unfortunately, it seems like cmdproxy.exe and cmd.exe cannot accept an > input file as a command-line argument and execute it. > > In the case of running : > cmdproxy.exe /c cmdproxy.exe /c C:/tmp/inp > > We get: > cmdproxy.exe /c cmdproxy.exe /c C:/tmp/inp > 'C:/tmp/inp' is not recognized as an internal or external command, > operable program or batch file. ... which means that I did not dig deep enough. Apparently, `process-file' is not passing the file to cmdproxy.exe. It calls `call-process', which reads file and passes its contents as input. So, we don't need to do awkward manoeuvring with "&" and making the src block contents into a one-liner. It's about understanding how cmdproxy.exe handles stdin. > I think it could be enough to make sure the input ends with a newline, in > which case it could be done the way I proposed in the first message, that > is changing: > (t (org-babel-eval shell-file-name (org-trim body)))))) > to > (t (org-babel-eval shell-file-name (concat (org-trim body) "\n")))))) > > I think as long as this change doesn't break the code in non-Windows > operating systems (How would we go about verifying this?), it would be > preferable due to its simplicity and minimality. This looks like the way to go. For non-Windows systems we have some test coverage. I am wondering if we should add tests for powershell and cmdproxy. Though only users with Windows will actually be able to run those. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at