From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id gNiGFo84HGTSKQEASxT56A (envelope-from ) for ; Thu, 23 Mar 2023 12:31:27 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id SEF+Fo84HGSHeQEA9RJhRA (envelope-from ) for ; Thu, 23 Mar 2023 12:31:27 +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 8FE3E93C4 for ; Thu, 23 Mar 2023 12:31:26 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pfJ9h-0004Jn-Ao; Thu, 23 Mar 2023 07:30:53 -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 1pfJ9Q-0004HQ-6d for emacs-orgmode@gnu.org; Thu, 23 Mar 2023 07:30:51 -0400 Received: from [2409:8a28:6032:c080:52d2:f5ff:fe16:c591] (helo=Mac-mini.local) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pfJ9N-0003bP-Ag for emacs-orgmode@gnu.org; Thu, 23 Mar 2023 07:30:35 -0400 Received: by Mac-mini.local (Postfix, from userid 501) id 1B62F8279955; Thu, 23 Mar 2023 19:30:24 +0800 (CST) References: <186283d230a.129f5feb61660123.3289004102603503414@excalamus.com> <87v8kd8zzw.fsf@localhost> <1863472efe9.10fdd5ba4258906.5972264927968042941@excalamus.com> <87y1p7axpe.fsf@localhost> <1870cb30c41.ba75a358545366.6275787333945468963@excalamus.com> User-agent: mu4e 1.8.14; emacs 30.0.50 From: "Christopher M. Miles" To: Matt Cc: numbchild , Ihor Radchenko , emacs-orgmode Subject: Re: [SUGGESTION] ob-shell async result output should not contains shell prompt Date: Thu, 23 Mar 2023 19:12:29 +0800 In-reply-to: <1870cb30c41.ba75a358545366.6275787333945468963@excalamus.com> Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2409:8a28:6032:c080:52d2:f5ff:fe16:c591 (deferred) Received-SPF: softfail client-ip=2409:8a28:6032:c080:52d2:f5ff:fe16:c591; envelope-from=numbchild@gmail.com; helo=Mac-mini.local X-Spam_score_int: 25 X-Spam_score: 2.5 X-Spam_bar: ++ X-Spam_report: (2.5 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FROM=0.001, MSGID_MULTIPLE_AT=1, NML_ADSP_CUSTOM_MED=0.9, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665, SPOOFED_FREEMAIL_NO_RDNS=0.001 autolearn=no 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: , Reply-To: numbchild@gmail.com 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=1679571086; a=rsa-sha256; cv=none; b=BSZbJfFSk4nCBZ2Gnf5/IWrmhOaHn0s8mP/232wscnDrSLW5t3+X89oHlB4DLYfCQxFDEi dCiEVqvjk796QrJ00B4RqJF1U3+/YG/ys0xWA/mNwgPUs45uwhmgOVLvqck7i/C8CpdTSv XMZVaMcYJTL7QWqDbHfcjODMWYI2ue3obn1Ul7/wiaNuHMPsUqWPGfbv3Mp0ZYvAdWWNNk Ye2cDM8038/fjobhJ7Fv5thLJA88etMaXzWA+Osp7y6eBUSNSqADfsLLDaU1lfk4doAMoO +hfGPpYBT0Rm2ueCgKnGB3bQIWppFoUmxPkv5ctyF9dffB9DAKnWgRTzzVHa0A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); 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=1679571086; h=from:from:sender:sender:reply-to: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; bh=7D0iS1TQhlLeEmIq+2zcqZH/kurVV1/Rv5NRFZzSAck=; b=JbBGtyRgBM1WL9UMlaBd6vDcJ1GXoI52Dtpdd5BzEG+5yORLLhDoA1j+fbeQ6U84pH+W2o QZnS23FcxCAD+907PF/hnX/YI9l7WeYOWBGpBkd5rHkTR4HIhFYaEIp9qY4yiN7MCtOrF9 z4nB8naYd8LWfu8nuISrHM0OjJDQ25mxOaxCIEB2KGMjTllDM1gb3Odk2pJCII5Sx3KoZt xxaOPAWbZMHiPYWTKys8UuSTXgiOUga6QKYvz8/R3z/Ijxm/Oo5tK863JBwY/9jtAR34C0 5IjAR+nv94txdohli23fIY4czhV3Quwh8hkkLoacDJTXCtO8IU4GKmyO8M6InQ== Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); 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: scn1.migadu.com X-Migadu-Spam-Score: -2.04 X-Spam-Score: -2.04 X-Migadu-Queue-Id: 8FE3E93C4 X-TUID: slj9gpJ/cZOL --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Matt writes: > ---- On Wed, 22 Mar 2023 23:25:50 -0400 Christopher M. Miles wrote ---= =20 > >=20 > > The ob-shell async result output contains the shell prompt. I think it > > should not be captured. > >=20 > > #+begin_src shell :session "test2" :async t > > sleep 30 > > echo "hello, world" > > #+end_src > >=20 > > #+RESULTS[(2023-03-23 11:19:22) 461ed5de684f6e619890709175ec73e80b67b2= d6]: > > : bash-5.2$ hello, world > > Thanks for reporting this. > > Try using for the babel language whatever shell the variable `shell-file-= name' gives. For example, if `shell-file-name' is /bin/bash, do this: > > #+begin_src bash :session "test2" :async t > sleep 1 > echo "hello, world" > #+end_src > > Is there a reason you're using "shell" instead of one of the shells liste= d in `org-babel-shell-names'? Using language identities like bellowing: #+begin_src sh :session "*ob-shell*" :async t sleep 30 echo "hello, world" #+end_src #+RESULTS[(2023-03-23 19:14:12) dd777a237986481833c08eb5eceac717576eddb7]: : org_babel_sh_prompt> hello, world #+begin_src bash :session "*ob-shell-bash*" :async t sleep 30 echo "hello, world" #+end_src #+RESULTS[(2023-03-23 19:14:15) 23f9ad130f7a1268e21821c6baaea2b057c70d3e]: : org_babel_sh_prompt> hello, world #+begin_src zsh :session "*ob-shell-zsh*" :async t sleep 30 echo "hello, world" #+end_src #+RESULTS[(2023-03-23 19:14:17) 2bb44d96c2e482a90c5a89bdde0b64d0319663a1]: : %=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 :=20=20 : %=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 :=20=20 : hello, world : %=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 :=20=20 Still got a prompt. Is this intended? I think the output should be kept cle= an because the result output might be used as input for other source blocks as data. Maybe error in my Org babel settings? Bellowing is my system and variable v= alues: #+begin_src emacs-lisp system-type #+end_src #+RESULTS[(2023-03-23 19:27:13) 7df8395169a77d83cb6a5a6efc2223d412813efa]: : darwin #+begin_src emacs-lisp shell-file-name #+end_src #+RESULTS[(2023-03-23 19:26:33) e6fed18a9a543dd6320385ee715d9ee68b464a04]: : /opt/homebrew/bin/bash #+begin_src emacs-lisp org-babel-sh-prompt #+end_src #+RESULTS[(2023-03-23 19:30:12) f6efc29dba5be2171eba0a25abec19908fb1c6be]: : org_babel_sh_prompt>=20 #+begin_src emacs-lisp org-babel-shell-names #+end_src #+RESULTS[(2023-03-23 19:27:27) 360d6d35db3eb48deb664349eed34b7541923ca2]: | sh | bash | zsh | fish | csh | ash | dash | ksh | mksh | posh | #+begin_src emacs-lisp :results pp org-babel-shell-set-prompt-commands #+end_src #+RESULTS[(2023-03-23 19:27:44) 910fbbafc6fea4a1846f5a31f8b7dd102eca4928]: : (("fish" . "function fish_prompt\n echo \"%s\"\nend") : ("csh" . "set prompt=3D\"%s\"\nset prompt2=3D\"\"") : ("posh" . "function prompt { \"%s\" }") : (t . "PROMPT_COMMAND=3D;PS1=3D\"%s\";PS2=3D")) =2D-=20 [ stardiviner ] I try to make every word tell the meaning that I want to express without mi= sunderstanding. Blog: https://stardiviner.github.io/ IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAmQcOE0ACgkQG13xyVro msPziwf+MRpnM0gLJfoIHrS1pUtsq8esiR8UFCCmSU+pndJh0c+JbKapZvOL4M6K 4qOmrR1WpHb47HQB6i/tEzvcmMLPpyo6ml9qjylVlfxBui3T75jMIZWYsOH04q0I Cnyg5TpsUoxBdo8esXGm5D5O1B9eRC2qmryL9522V3OXUof5f8IaxfR4Vx3xFcQA LjpQUyondAdnK2KDLPkIakUVpvH6tIP4x0VMSMss4KwEVR6eJ15TVOiWnkNk9Zd7 b15OejBLY6KrUaQ162E9NDF79UzXjNor6f1NGVN+TFGuUYLC35VpS5SP47g/4Uze plmNuhRRdxPNPsMrHzHEPybcaxV/fw== =/iYc -----END PGP SIGNATURE----- --=-=-=--