From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id 0CRiHAXqwGUQIgEAe85BDQ:P1 (envelope-from ) for ; Mon, 05 Feb 2024 15:00:37 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id 0CRiHAXqwGUQIgEAe85BDQ (envelope-from ) for ; Mon, 05 Feb 2024 15:00:37 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=TbcQ4GMo; 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=1707141637; 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=buvXIEBC5hcuQAeg8/mrZSC9m8gHAjFCVjhQkSlrPRQ=; b=ujufd1tfMMUDRjOtAwu48HZKkvNk88xluhZoNq2o7yfYVofOlwYOir5tpclEL7cWguW0dk +XP9uKeRJQ6gRcAQfkb02qu/y8uSxynw3kFkZk1eCPZhn7ztqjXYgsspMNCiI65jY4yntz dUmXEzJVy29mc4UMhYPNt+ZgHOK88ad2y7ve6FCXATj9I8bPKN5FXvTEor/0XecFLv+CA9 Qzr3FJ7VTDMPBXwrtRbZ1eOX2Mv5BfGuxvjKbOUODhMYOZ/rrBpBsFcMrXUyW3cfLeDAeq wHXdTXoiiTOJVnrQ1rI/WJj1QX6Vi2rRfNZbupbj+bSIaORIS7fEHtG+d7X+1Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=TbcQ4GMo; 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-Seal: i=1; s=key1; d=yhetil.org; t=1707141637; a=rsa-sha256; cv=none; b=rQuLBdqx6NkZzLsXTODpqlVBmvmTlRitJVTDar79ZbJaKsQyO8kZ/G/9N0MQiu+beI5dL6 m05m5r/ralBCLgZ67amhARMa8VltxJSaEV6iKfs7bjhXta/MgXRTK3STj+eGdJ2DXTonfa H0NSl1rjkKe3NjiddG3ZyTx7j6aHkItONwZK0WKVn/fkkASq40RrUlo4VThGlBTH846LmK 3ErKd89hDn+xmfjS4Vye7vwSDK4xAHDZxacHhSMPRKePO5KH4cklL1qJWsn673xxQnuY7P 1J6jzY6cg2f3sljTYX2V7fwY2Yv3IDaXNiX+pZguMGAjd6yf8otsOtBkcW5dVQ== 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 482D919EA3 for ; Mon, 5 Feb 2024 15:00:37 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rWzVZ-0002GB-Oi; Mon, 05 Feb 2024 08:59:37 -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 1rWzVX-0002Fn-Hb for emacs-orgmode@gnu.org; Mon, 05 Feb 2024 08:59:35 -0500 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rWzVS-0003LB-0P for emacs-orgmode@gnu.org; Mon, 05 Feb 2024 08:59:35 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id E0D1D240028 for ; Mon, 5 Feb 2024 14:59:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1707141566; bh=PzFMfY2vZ1849/ca0Mt3dyf6uCh5lIelsgqVJ2gs1LA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=TbcQ4GMoKLmgszLkrTBXbM7dECTVm0n8jMY3VKrKJBCP+2iXJ88vEuq4If3jNMZsD odknPZWDofbCfBdkyNqWUUmEcslDiPZZCDK49ViYy//obPcgDxAjftqbjVjB8TckJH imp61IEzsvdIrCtVnoYjhcMlUtNRoQEMxOI6huJLpmaH2JBwHWzBRrYU7lngFgffoT eMaN14GzgUBEcnkyWefyaX4GV+Gz9Sc9Kjm5+UMei1YZpEYnSII2e0ADbJWV9Ow+LZ /i8p3GWtU2ar3ck3WInWelrYD6XAjMg3mvHO27StiYTs8i5rSFNQMJGx0UZXtkdxbU TLSnxwWwKRuLw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4TT7KT6MqCz9rxL; Mon, 5 Feb 2024 14:59:25 +0100 (CET) From: Ihor Radchenko To: Matt Cc: emacs-orgmode Subject: Re: [BUG] Prompt appears in async shell results In-Reply-To: <18d753c1e8a.cfb3e1921191837.5665565128507976741@excalamus.com> References: <18d753c1e8a.cfb3e1921191837.5665565128507976741@excalamus.com> Date: Mon, 05 Feb 2024 14:02:55 +0000 Message-ID: <87ttmn9fg0.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.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_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_HELO_TEMPERROR=0.01 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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -9.62 X-Spam-Score: -9.62 X-Migadu-Queue-Id: 482D919EA3 X-Migadu-Scanner: mx12.migadu.com X-TUID: 4kpfHvdrVXZr Matt writes: > #+begin_src emacs-lisp > (org-babel-do-load-languages 'org-babel-load-languages '((shell . t))) > #+end_src > > #+begin_src sh :results output :session *test* :async t > cd /tmp > echo "hello world" > #+end_src > > #+RESULTS: > : org_babel_sh_prompt> hello world Confirmed. > ** Thoughts > A quick fix is: > > #+begin_src diff > modified lisp/ob-shell.el > @@ -289,7 +289,7 @@ See `org-babel-comint-async-indicator'.") > (defun ob-shell-async-chunk-callback (string) > "Filter applied to results before insertion. > See `org-babel-comint-async-chunk-callback'." > - (replace-regexp-in-string comint-prompt-regexp "" string)) > + (replace-regexp-in-string org-babel-sh-prompt "" string)) > ... > I'm not sure this is the best way. It is not. It works by accident. Other edge cases may appear with chunks containing parts of the prompt. > It seems to me that we should extract the filter from =org-babel-comint-with-output= and use it in both =org-babel-comint-with-output= and =org-babel-comint-async-filter=. Yes. The right fix would be extracting the filter from `org-babel-comint-with-output' and re-using it. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at