From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id eAB3OIIBWmPdvQAAbAwnHQ (envelope-from ) for ; Thu, 27 Oct 2022 05:56:50 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id QOhEOIIBWmMY/AAAauVa8A (envelope-from ) for ; Thu, 27 Oct 2022 05:56:50 +0200 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 B046D2FBF for ; Thu, 27 Oct 2022 05:56:50 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ontwU-0003Qe-TO; Wed, 26 Oct 2022 23:52:30 -0400 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 1ontwT-0003PM-4K for emacs-orgmode@gnu.org; Wed, 26 Oct 2022 23:52:29 -0400 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 1ontwR-0001Sn-1p for emacs-orgmode@gnu.org; Wed, 26 Oct 2022 23:52:28 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id DCD6F240101 for ; Thu, 27 Oct 2022 05:52:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1666842744; bh=nd89MRR9DOmDVxmq5TQYp45KH9VhydgxVPAB2qo18lc=; h=From:To:Cc:Subject:Date:From; b=AO6NotT6yi7CholwjJKaiCZw+/eirCbNIuVl6uwotplcdfzwcVNpsn8T3nS7+k82A kjAKtreyq9KYdcedDv/0dIQ6c+waEpAv6p9HICgrHz04CWnv67Wch9pJEYA3jCKEoS MsuY23gz5GhhqAc6EdQcSHVYO3FcB0JLXPa6VwsAdVqUgF6QgC0N78OmCEYzU3jLkS 360Nwkk3NxJIB5b8mLSDG1Lm+AqfnWHMfZJdzmrt3HRQBFyEIy2fb0sVIsrw5UzGLy JOCtqv8ibYyk5PhQD+BV0AV6VayPMxiUAVF5wy5i+8RbP/DLRucMzsx+UYRRaG8pgL JJRr2w1Nn3+eA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MyWw42w1zz9rxB; Thu, 27 Oct 2022 05:52:20 +0200 (CEST) From: Ihor Radchenko To: Rudolf =?utf-8?Q?Adamkovi=C4=8D?= Cc: Ihor Radchenko , emacs-orgmode@gnu.org Subject: Re: Org 9.6-pre and Bash sessions In-Reply-To: References: <87edvbysqc.fsf@localhost> <87r0z6j1b1.fsf@localhost> <87pmel68y6.fsf@localhost> <87o7u432tl.fsf@localhost> <87a65o15ut.fsf@localhost> <87fsffqi49.fsf@localhost> Date: Thu, 27 Oct 2022 03:53:02 +0000 Message-ID: <87wn8lorc1.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_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: , Sender: "Emacs-orgmode" Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1666843010; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=l0+4L7EsMXvEXJHAza/HA8qEOax9eEniJUzxVhqsZEU=; b=Ny5HPKYBhlPvzuqOnCNBib6bOXqMYTvcRCt9Oot9YeWXL7BBGpDGU3xq4FngQ5ZKZg6Dj+ T948lliD5gfWljsiUQI4KNW8cJuj0qghkQpAaDce8RBvuuHVPKeDrmO7EjHHwnyt9my3P1 qBjsvdLpr0EmjjVZJyig88lKi1AyKWQcxiHFuF33zXOlxT3Nimf2E0JlxNu1wG9jjhkSXx jm/i/Aqnj7+Vt9O4dXc5ktsIzEaTSDYOUABRyXZNRDLc5A23DvdCsQaA6UZkN2IqWWIGSl E92LZk3wdKriTo6tXpIwQ4IQEwo5tIq2NGWi0Y6f44Tr5DcfDsX3qmLYiLyoXA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1666843010; a=rsa-sha256; cv=none; b=NxZqlPtrBPWIzMoJbgegEzJRS584RnblFdqBgyLdcXB7wLHYzM1swOHoDQGzMbOfBxDPT1 EZKmegw04dUW0449a6rm3SykLWEPYp7aeJ97LUoOiZySlr1ZKyP38X666vL4tE5sHF6xiu vxGzGsUqQQZ3ZB/QdUcmOQ9zIYesOWzUQp7UEcWn3GyQbNriJz62lPnAyPRNUYW4Y3BfiU vPpjoepKSf1jbOR5j7ruwWdqm9/OyEFIlZHTPyKC+Ukw9vzva3iJdY7HL6cAATFPP31xqw c68Q6VZQkFHspALNJaNtqV0zphNnEtL3aXW3KkAhe+aicI4H3G6BuaopSZK3zA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=AO6NotT6; 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-Spam-Score: -1.92 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=AO6NotT6; 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-Queue-Id: B046D2FBF X-Spam-Score: -1.92 X-Migadu-Scanner: scn1.migadu.com X-TUID: Q76KYpTaePbD Rudolf Adamkovi=C4=8D writes: > Thank you for investigating, explaining, and also fixing the problem! I > pulled the latest 'main' and everything works a bit, it seems. > > Then, to avoid walking in circles, I decided to write some tests, for I > think shell blocks should never, never, never break in such basic ways, > let alone in production Emacs. Thanks! I will not look much into details of the patch for now. Let's discuss the general expectations from shell blocks first. You seem to be missing several things described in the documentation. > I noticed that the following tests do not pass: > > 1. ob-shell/error-output-after-success > > We seem to trash error output, such as warnings, on success. I think > we should not do this. Now, on the execution of "echo X &>2", Org > says "Code block produced no output." But that does hold true. The > block did produce output, just on the other output stream, namely > error output. Trashing error output is expected by default. I suggest you to read through https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-shell.html The default :results argument is output, which implies: output returns stdout, default As expected, stdout is empty in your example. ob-shell follows the spec here. Another question is if users may want to obtain strerr in some cases. A new feature like :results stderr might be implemented. Though users can already do the usual 2>&1 to merge stderr into stdout. > 2. ob-shell/error-output-after-failure > > We seem not to show the exit code in this case. Why? Exit code was not shown in the past until my commit https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=3Dab7eff9d9= c0968392bd9783d72c56a4023bd10be I guess that showing the error code unconditionally (when exit code is non-0) could be an option. Now done in https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=3Dd87a496b5= 4b502d98e49f8bd6596e0562be9d105 > 3. ob-shell/exit-codes > > Should we add a newline after the exit code message? Done. --=20 Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at