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 OOjSJRlfbWNDQAAAbAwnHQ (envelope-from ) for ; Thu, 10 Nov 2022 21:29:13 +0100 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 iLQWJRlfbWNufAAAG6o9tA (envelope-from ) for ; Thu, 10 Nov 2022 21:29:13 +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 4AEF482A0 for ; Thu, 10 Nov 2022 21:29:13 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1otEA1-00037E-9r; Thu, 10 Nov 2022 15:28:29 -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 1otE9z-000372-Gn for emacs-orgmode@gnu.org; Thu, 10 Nov 2022 15:28:27 -0500 Received: from smtp6-g21.free.fr ([2a01:e0c:1:1599::15]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1otE9x-00079w-6y for emacs-orgmode@gnu.org; Thu, 10 Nov 2022 15:28:26 -0500 Received: from tosh-laptop (unknown [IPv6:2a01:e0a:505:3460:1a16:a0c4:3f89:c0d9]) by smtp6-g21.free.fr (Postfix) with ESMTPS id 4B58278034E for ; Thu, 10 Nov 2022 21:28:19 +0100 (CET) Received: by tosh-laptop (sSMTP sendmail emulation); Thu, 10 Nov 2022 21:34:21 +0100 From: Bruno Barbier To: emacs-orgmode@gnu.org Subject: [BUG] org-babel-comint-with-output: incorrect prompt detection [9.6-pre] Date: Thu, 10 Nov 2022 21:34:21 +0100 MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a01:e0c:1:1599::15; envelope-from=perso.bruno.barbier@free.fr; helo=smtp6-g21.free.fr X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FROM=0.001, MISSING_MID=0.497, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action Message-Id: 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1668112153; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=fiTBBzpEObRuNjcXLgF+U9MlRMR96LLU5qnmNmR6oIk=; b=hbvbQKXJpr10R19rs5YlsRcsXuJsr7HNeqFQsjHICH07LmnNwifZ03fJ4uO7pd61lgeDqj wooWM4uyoNQ2HWLkUHaJ9JafEgp2dbkOq/KmtkONKpA1C5mlgWQ+YGaiqJykCcm9kK5vta dxRqrd/lzvjYNvMzFeihT6j931yerIaZWO8tPjD/qXntf82e2daMfddHXyKH1AHb0qE8nj 8lQa6pGyCXiIiwMe3/Z7Vm5kF3/iYzJr9BPTMOE5ouC1rJIQwZCZQUkQToeYZKui+Vp43m ZN/xvfQcxRsEwTu4kEYEI2q2apwhv4kkvpcl2b1Ry88F/cPzCC/fxs130vGIWw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1668112153; a=rsa-sha256; cv=none; b=PM6eZNVl20k21chqNrkEjzr5NaN1KdRER7Pb5DLAJ5Vvv2EmK5F6VJIeliJUbiKSMynlAx WY+njQWVvUQE84mSu3vjXRF1nQkUND/G5MWdWriWhGJqqdLFf3eMk/ZidSDgYdwYHgHD0G +xSTBekFtVHtCVMXcvXXtrEpIz92PbMuCFkAm3SFmBueT13wLgpY8ic/csEQl9TVjE5roJ 9ajCqSYrJuCZPLqSO4rVkq6qA1NvnCWbjmmLEguf2V1EmZE7j1/ZuwCgWsABlSeK8Pw1jk HtM5QG7hF5xNDxjkplhR7cZaiDcbtT7N7C1IX/AtLBL1mgbzZtdPmj6yxmh6TQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=free.fr (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-Spam-Score: 2.38 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=free.fr (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-Queue-Id: 4AEF482A0 X-Spam-Score: 2.38 X-Migadu-Scanner: scn0.migadu.com X-TUID: kyptSnSIMod2 Hi, The function `org-babel-comint-with-output' (o-b-c-w-o) may not detect prompts correctly. The function o-b-c-w-o checks if the incoming arbitrary chunk of text contains whole prompts, and replace them. But the incoming text may contain an incomplete prompt at the end. When this happens, it will miss that real prompt. For example, using a haskell prompt, let say the prompt is "Prelude> ", the first incoming text is "Pre", the second incoming text is "lude> ", o-b-c-w-o will wrongly infer that "lude> " is the prompt, and that "Pre" was part of the previous value/output. This is with current main (after commit 1ef420b19d2e310d9ef67e090ef84cdb6da4744d). I'm randomly hit by this bug, when working on tests for ob-haskell. Let me know if I need to provide more information, Thanks, Bruno