From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id GDWSL+rEHWSjOAEASxT56A (envelope-from ) for ; Fri, 24 Mar 2023 16:42:34 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id GLiXLurEHWShXwEAG6o9tA (envelope-from ) for ; Fri, 24 Mar 2023 16:42:34 +0100 Received: from lists.gnu.org (unknown [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 8A1E3A78F for ; Fri, 24 Mar 2023 16:42:34 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pffRi-0005Y8-OO; Fri, 24 Mar 2023 07:18:58 -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 1pffRb-0005Xl-GZ for emacs-orgmode@gnu.org; Fri, 24 Mar 2023 07:18:51 -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 1pffRR-0004ur-83 for emacs-orgmode@gnu.org; Fri, 24 Mar 2023 07:18:51 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id C4AA12406B1 for ; Fri, 24 Mar 2023 12:18:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1679656701; bh=2OOz/6JIYyWI0c6zkGIKwYfwhPtQiFrADsifRNzR+uA=; h=From:To:Cc:Subject:Date:From; b=J0O1uVB0KmEv35Iqoj7IT1EdjOfrgg9cfVURvfGroxTMaPaFqF/cmG+BcvBkIBICg 7DuleTSesoKW1d8k5kN5oGbFA7IFmEQrJS84LjRvOYMR8IeYm4NvboGKDdGV/67Fg/ bIneLds/XfRVqgl0XBVbDdlUqhV5ztjiyH2zp56cxsbVo2INiS3Zf8EkcIUr2VbiSh 53kQ1UJjZ7zxFK3Q8MrCJv/IrpnmDzJr2IibCv2UsxbdSspDjy7ps8yfGRb9f0euzQ pa2f2xhPHR3HcTbvLGIogNJ4SSsVYU//Gd7Ow4azeuTrSDY024CEwo+rRdXyg09Yo5 t9NhYnJa9lc/Q== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Pjfp04Krvz6tnP; Fri, 24 Mar 2023 12:18:00 +0100 (CET) From: Ihor Radchenko To: Matt Cc: numbchild , emacs-orgmode Subject: Re: [SUGGESTION] ob-shell async result output should not contains shell prompt In-Reply-To: <1870f489edc.f5692336744686.2501966448088129374@excalamus.com> References: <186283d230a.129f5feb61660123.3289004102603503414@excalamus.com> <87v8kd8zzw.fsf@localhost> <1863472efe9.10fdd5ba4258906.5972264927968042941@excalamus.com> <87y1p7axpe.fsf@localhost> <1870cb30c41.ba75a358545366.6275787333945468963@excalamus.com> <1870f489edc.f5692336744686.2501966448088129374@excalamus.com> Date: Fri, 24 Mar 2023 11:20:03 +0000 Message-ID: <87jzz6xuos.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=1679672554; a=rsa-sha256; cv=none; b=ABslj9BOBSjHxk73n5dVve5p3KJCiTR+MWzB50GsvS1bpI036+AHrQpdR9LFzQ8JuSL7ls zJCrSogSEqIQwgICmBrt8IvHBjFyN8AFGOLf4ky8Vpqjh9PkXzUx0vQbSznkONpj7KdBoc bKR8QWejEMszxrLTvwR9gWQfqv//gdMITjAZDmJ1ScKR3/cqIOr/OOtPKLeGatgQcjq2H+ kaAyeuDmH5QzmyWPYbifF1U/roYPLWD9UQQRHPdmGEl8bvRTPYi6zwIXafzrbjneop6fg1 010J6A/aCem1itxW7WkMOzdG2TkQe9ZquObdSDzz5lGNmocprcLaL9q8p8BtgQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=J0O1uVB0; 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=1679672554; 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=UDcNYe+BUvUtNwz35tcZVXIvY+xfGfuPGa0D8pE+dBA=; b=Pk+VijYE6hpFkfjn7JcDL255iYfpXa19MSvBEg+1dgALWncQa8RE5OhCO6tJnf4shYYyF7 H9xGYGfqPWMmp2akOs6vmmBPiPEFq+SvrgcLumqnhIr+ljvmPb0lnFZX3HKsQBxDSraZaS kK60s7m8Ini7oiBzXAjxQcKWh57+fFjpREg1a7BirIvaP6Ue//tOLchsD2nsMbLueqDHrG jI4ePtaW9cRSYf+N24o4Xyz1NkmU3OFaP7XzZdGfNQ0cXq3Wf3bGVWhNcpLcDETATyFLOK GkdvM77mRCBfylD6Y9UfeEzYrMKjCiT2y71P6oqNXgYp9zvqBmgAhwbLuNheNg== Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=J0O1uVB0; 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: scn1.migadu.com X-Migadu-Spam-Score: -3.75 X-Spam-Score: -3.75 X-Migadu-Queue-Id: 8A1E3A78F X-TUID: +0TnivzjETaw Matt writes: > Changing the `ob-shell-async-chunk-callback' like this will fix it: > > @@ -276,7 +276,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 (concat (regexp-quote org-babel-sh-prompt) " *") "" string)) This is trying to replicate what `org-babel-comint-with-output' does already and is stumbling upon the same edge cases. May you instead factor out the filtering code from `org-babel-comint-with-output' and reuse it in ob-shell? -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at