From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.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 sCCjHarbn2IjZQAAbAwnHQ (envelope-from ) for ; Wed, 08 Jun 2022 01:13:46 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id +A+VHKrbn2ImRQEAG6o9tA (envelope-from ) for ; Wed, 08 Jun 2022 01:13: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 A31DD7B40 for ; Wed, 8 Jun 2022 01:13:39 +0200 (CEST) Received: from localhost ([::1]:37208 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nyiOG-00011T-QP for larch@yhetil.org; Tue, 07 Jun 2022 19:13:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51614) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nyh3K-0001n8-E9 for emacs-orgmode@gnu.org; Tue, 07 Jun 2022 17:47:54 -0400 Received: from peaceful.gatewayhost.com ([144.202.44.248]:38101) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nyh3I-0002MN-O6 for emacs-orgmode@gnu.org; Tue, 07 Jun 2022 17:47:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=hacktivista.org; s=mail; h=References:To:From:In-Reply-To:Cc:Subject: Message-Id:Date:Content-Type:Content-Transfer-Encoding:Mime-Version:Sender: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=zRrkmFSkq5dKahpM8tqzp0iphkpslUWX6Oil4vJUBN0=; b=QFoSuKb8dKb754LfTUyyjwGonH eBfNC13V8M2qhEpPfWVHjNFjMhTqrmTyb1l2LuSwb3M0FjCFyXIAoFrGIYg/6I2W08wpepnEMOTuG buhO3rQ2uoyTcjkg0o2qzLmdprUUb/2KfU1uKauUGa6DXrrzbHc/xlBI26iWNraMxSUs=; Received: from [186.105.147.26] (helo=localhost) by peaceful.gatewayhost.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1nyh3F-002PRd-6v; Tue, 07 Jun 2022 17:47:49 -0400 Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 07 Jun 2022 17:50:01 -0400 Message-Id: Subject: Re: babel output seems to drop anything before % (in session) Cc: , , In-Reply-To: To: X-Mailer: aerc 0.9.0 References: <875yt0myv0.fsf@localhost> Received-SPF: pass client-ip=144.202.44.248; envelope-from=libsys@hacktivista.org; helo=peaceful.gatewayhost.com 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-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" Reply-to: "Felix Freeman" From: "Felix Freeman" via "General discussions about Org-mode." X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1654643620; 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: 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=zRrkmFSkq5dKahpM8tqzp0iphkpslUWX6Oil4vJUBN0=; b=AywxbVwn6qBoHiyprmWWwlOyT6PwPh1Q/RKrb3AMucypvq1DmWuWeGvQCE8r1/OpBywx/w f9ozeTsGW0teC8Z/WROsaoR72ixOE74/MDFTiXzb9eVXD9zfUf0b9fqZUthxoBnzkg7YjX 5pRt6SsE77pBGCptdIlI+NIjJYOsaam1edsWTNKxIjYCj9fFNT2cCnqdmmdlP+JirL5VrM akneK/2Ovbig0DUUoJ1cTGe6BeYO/Vl7+W2TF7toro6LgiCCTpu+aGVbFAtNhH1OMPipzx emDq7p2vf/v9ePZSg7XAsYYNRktMJ+/WlWQxz/WHV+xPZTkLpe0y04HUcA3Kmg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1654643620; a=rsa-sha256; cv=none; b=n7lKmhUJSc/Ss5jBNSv8AMVAu/Lg5q+dZYEHFEPIryC4VNv/jPIGKp2T7xcwsMeKKeSNAC 0SJbcM4JKozmEICEEoNW/am8TiYD/aNh/ukjxOw96vGErZBb35enhOC/bthw6SQO3OYyKH yy2OMGVrFCJtlSLCdmKDzSCQBJU7rYB0v7s3xpNgWHP/plboI+TCwZEG17iwasmD9NEHBO DIlWeF2VyLlFpoCZfvTTxmli79dyOStRkWCMn02nY1terF4xSN4JmRIaRQ1JM6Na0rqLUs zx6U1bExCMsyMYXzsYJ9ATynwwR6D72eYWWMpmYyM62jA4wMzsrcssI6VjX3zw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=hacktivista.org header.s=mail header.b=QFoSuKb8; dmarc=pass (policy=none) header.from=gnu.org; 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: -0.01 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=hacktivista.org header.s=mail header.b=QFoSuKb8; dmarc=pass (policy=none) header.from=gnu.org; 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: A31DD7B40 X-Spam-Score: -0.01 X-Migadu-Scanner: scn1.migadu.com X-TUID: By8FC6YtEosy I've been able to bypass the error by adding the following to my .emacs (require 'ob-shell) (defun org-babel-sh-strip-weird-long-prompt (string) "Remove prompt cruft from a string of shell output." (while (string-match shell-prompt-pattern string) (setq string (substring string (match-end 0)))) string) (setq shell-prompt-pattern "^sh-[[:digit:]].[[:digit:]]\$ ") Of course, this is is just a dirty hack not suitable for a release. It seems logical that `org-babel-sh-strip-weird-long-prompt` on `ob-shell.el` respects `shell-prompt-pattern` from `shell.el`. It's not like this on the released source code. But to be honest still the idea ripping a dynamic string from the shell output seems pretty hackish to me. I'm not really aware of the internals of `comint.el`, but I think that instead it should set the shell $PS1 to an empty value and read the thing afterwards, or - if this changes things too much - at least set $PS1 to a very unique and distinctive value in order to avoid these kind of bugs. Felix Freeman