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 kCe1KUpWKWQfNQEASxT56A (envelope-from ) for ; Sun, 02 Apr 2023 12:17:46 +0200 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 QDTCKEpWKWSIFgEAG6o9tA (envelope-from ) for ; Sun, 02 Apr 2023 12:17:46 +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 48F2445666 for ; Sun, 2 Apr 2023 12:17:46 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1piulY-0001Mm-0k; Sun, 02 Apr 2023 06:16:52 -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 1piulW-0001MD-IW for emacs-orgmode@gnu.org; Sun, 02 Apr 2023 06:16:50 -0400 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 1piulT-0004Q6-W4 for emacs-orgmode@gnu.org; Sun, 02 Apr 2023 06:16:50 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id E5E25240311 for ; Sun, 2 Apr 2023 12:16:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1680430604; bh=oLu3Ak/8cDJLA/PindRye1h07FD6o5+XpRKjGzv5EYQ=; h=From:To:Cc:Subject:Date:From; b=Bd0pE1EYYWNlSXrNYuReGsxY+dsBJnZrorR6xE9Uuc1x0IF/sI8mKHoFjt+GA242a I3NVVLOcr4K7inBP78dGFD3OB/WxQibXSKnwrMtRaW8D1yAXTB29ZSWdkXZiUyGkYm tOTNBcgtH+xfdVXA7SbH5p7Mr4ttz/JvwYNOy1k6E+VoxbB5gjO7iQphHs3gzhb0bn 6m9yPWkPrmFkVaD+Q7Br9ELPFphd6mqfHPEAnSjnJf+rvn/cjv3wFkflsRvzNCKN4p +UKwi7BD0aAmv5Ixji6mhQbWXlvrfvP5dJ/8TImYXBE1FbTGAX9P+Q64196lCT2ao4 nJ9vEZ6GeIqRw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Pq9182PS3z6txZ; Sun, 2 Apr 2023 12:16:44 +0200 (CEST) From: Ihor Radchenko To: Samuel Loury Cc: Org-mode Subject: Re: Make org-mode multi line shell session work sensibly In-Reply-To: <875z47c08y.fsf@gmail.com> References: <875z47c08y.fsf@gmail.com> Date: Sun, 02 Apr 2023 10:19:00 +0000 Message-ID: <87y1nalh7v.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_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=1680430666; a=rsa-sha256; cv=none; b=sOAQneTs+80A5kDKpt3K8dVxyibF3pQB5NeG16Pkr4O/DiNVpd3dmXEm78/sD4pEDELLdK Epi7MLX05P5wLQhmfambQQbcmDxABH/v/UB25Vsshv3pO0SlYAHZ2Zowpdy2306I15Efd5 3spJPdQoTV2xiVJdGoLkBzmEz6+YQ5oazmhPDEiY8Gn+aYyjCqvDdM78EaGqBm5eJkXw87 mgazF2qjYRrEPtwDK8t+XQwlus9pkHsFLp+6uKGD8EjNRx7Wqd2dN2NyYWjO3KrgosSjGQ +l9SygyNTejoN0LM1mpjg1FascO/uMhjf3hP9PqnylYX5i9lNSRGlYD8ekkdLA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=Bd0pE1EY; 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=1680430666; 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=/NlsPzRQnEsch9S35crjssRIoktmLTanrPjtEp4/+H0=; b=j5Vh2zwdEIjeYADf0gpMRBarJG8VM8PQSI9a4hTzwa5MTHoXj+nLcD8YdT7Yt10SxxhVpp X5QTzX6MsEFdMgiYb59Bvg80jAH8HO2qP7KoCN0kH0FGShy6i0T0owfSDOCSkkCWM67u3w PXwxFJj5t1uwcMLuVGBM/GQA4jL8Ui9wDWaBHh1/kTwjBInzkzgoGTGHJ74a7tKqLnQo1B xbwvTgJUpgAl4GrMMrFOLKkBN4+wKZdrBfquyb1jfs5xhyIt0crK+Y1XYvW4NPN6TAs6xH BtZpK3OXdcO7tLdc4aiZcGnAv7FBqdH4Erq7RXChQfAZREabnADbX+Guzap8mg== X-Migadu-Spam-Score: -4.74 X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=Bd0pE1EY; 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-Spam-Score: -4.74 X-Migadu-Queue-Id: 48F2445666 X-TUID: Yc8XcdnLl8gf Fixed. Samuel Loury writes: > The symptom is the following: When I try to run a code block with noop > lines, like comment, the output gets broken > > --8<---------------cut here---------------start------------->8--- > #+BEGIN_SRC sh :results output :exports both :session c66d4791-003d-42af-a4e0-366f5542c604 > echo a > # noop > echo b > #+END_SRC > > #+RESULTS: > : > : a > : $ b > --8<---------------cut here---------------end--------------->8--- This has been fixed on main in a series of other related bugfixes. Not on bugfix though, so I just cherry-picked the relevant commits from main. Your example is now working fine on bugfix. > Then I took though about it. I cannot believe I am the only person > trying to run multi line shell programs with comment in session, am I? > > So here are a few questions: Is there anyone with the same use case as I > have? If so, how do you cope with the problem I am facing? If I want to > fix it, what do you think would be the more elegant solution: fixing the > line by line parsing like I was trying to do or sourcing the code to > avoid using line by line parsing? Well. This issue has been introduced in the last minor release when we attempted to fix another bug with Org babel being too aggressive when removing anything that looks like prompt, even when it was not prompt. This whole comint thing is tricky. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at