From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id sLNHCXu3kmCnpgAAgWs5BA (envelope-from ) for ; Wed, 05 May 2021 17:19:23 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 4GTZBHu3kmBaLAAAB5/wlQ (envelope-from ) for ; Wed, 05 May 2021 15:19:23 +0000 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 7A58C2F6B4 for ; Wed, 5 May 2021 17:19:22 +0200 (CEST) Received: from localhost ([::1]:34624 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leJJ2-00061c-TM for larch@yhetil.org; Wed, 05 May 2021 11:19:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34658) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leJHm-0005zW-Jx for emacs-orgmode@gnu.org; Wed, 05 May 2021 11:18:02 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:38991) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leJFy-0006ba-2R for emacs-orgmode@gnu.org; Wed, 05 May 2021 11:18:02 -0400 X-Originating-IP: 151.38.138.166 Received: from spx.localhost.invalid (unknown [151.38.138.166]) (Authenticated sender: me01@toel.it) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id B332A24000D for ; Wed, 5 May 2021 15:16:02 +0000 (UTC) User-agent: mu4e 1.4.13; emacs 27.1 From: Daniele Pizzolli To: Emacs Org mode mailing list Subject: babel output seems to drop anything before % (in session) Date: Wed, 05 May 2021 17:15:59 +0200 Message-ID: <87h7jhus7k.fsf@spx.local.example> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=217.70.183.193; envelope-from=dan@toel.it; helo=relay1-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1620227962; 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=SYSTsU8reT1hSNglp1xfF8A/nrlw7ofSUS2AxPecrNU=; b=gUrty9/7UX8718Z4A53o2IuiGsGdGLziPozXCxJ0uKLJ/+R/DA4ueyEdVsr1zSqUT/+an9 weZLjtyoKcTa5stzabSme9AB4oSfzWrmKiSTMgu9js9g8jO09BDtK3Spr8aLF3iG+zTkra rSkLjZ3dLq2COESLEbYv2GQbWnJ17irE3gzJhkyfnHtXHCVn/pvF3hZE54KapTLXngroVb xHeNDmuOhkdbNOG7Z02qGbr30hN6AbILDNtjVm2J2vhEP/XNwYARnNuE/6qbgV1GUsu58T dCb0s5Q39JZUBHyRVR6wd4MP5kumxlDT/xJflia+cMHZC4Rz9q+jo8Ha/TOKGg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1620227962; a=rsa-sha256; cv=none; b=e4bpV8n0Wl7zJROCshY30UQHBo1DE2RxrJTi6nNxcvC99dqyinlXjVxYF5ZKp3LB8vR11o aNquxr+hIvcYcwbquT8mchPL9oWwFGKIkmmDh48iXN80ymhpRWK+ZP8bCRFyUqyEiL1Jwq KIbMk+f1n/NaDEc9IuQCuP/ODaBtcNRK48P0ng+y+fWKmLB7Rh29K9VLoM25Oa1Ilfx8HC tt6TVIbYXGD5zzF4VoNdIUUUh4z6JcxsFElJQ+gHGBhFU97mRQ65qCNkNyBK4dj5bNRZoC MwLU4pqBXTk6BkhdcLl5bMR2sVAlleUhZhmbZ3dxQFUXupRJQckw1gcoCTc2bw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -2.47 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 7A58C2F6B4 X-Spam-Score: -2.47 X-Migadu-Scanner: scn0.migadu.com X-TUID: SuYAtvrn2uTY --=-=-= Content-Type: text/plain Hello, Try to execute a few times the following and see the output corrupted in the line: #+BEGIN_EXAMPLE 1 packets transmitted, 1 received, 0% packet loss, time 0ms #+END_EXAMPLE #+PROPERTY: header-args:shell #+PROPERTY: header-args:shell+ :results output verbatim :wrap src text :session test #+NAME: ping #+BEGIN_SRC shell ping -c 1 127.0.0.1 #+END_SRC I tried to write a test (now with the :expected-result :failed), that hit the problem both in main and master (applies fine to both). I was not able to fix it, but hopefully the tests are still useful for somebody more knowledgeable! Thanks for you suggestion/fix! Best, Daniele --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Add-disabled-test-for-in-babel-shell-output.patch >From 897ae50cf055d459d741c90f8de94dd56a8eb3d9 Mon Sep 17 00:00:00 2001 From: Daniele Pizzolli Date: Wed, 5 May 2021 17:00:28 +0200 Subject: [PATCH 1/1] Add disabled test for % in babel shell output --- testing/lisp/test-ob-shell.el | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/testing/lisp/test-ob-shell.el b/testing/lisp/test-ob-shell.el index 0aadb355d..a42cc3d77 100644 --- a/testing/lisp/test-ob-shell.el +++ b/testing/lisp/test-ob-shell.el @@ -106,6 +106,35 @@ ob-comint.el, which was not previously tested." "#+BEGIN_SRC sh :results output :var l='(1 2)\necho ${l}\n#+END_SRC" (org-trim (org-babel-execute-src-block)))))) +(ert-deftest ob-shell/percent-simple () + "Test percent in output." + (should + (equal "one 0% two\ntree 0% four" + (org-test-with-temp-text + "#+BEGIN_SRC bash :results output verbatim\necho one 0% two\necho tree 0% four\n#+END_SRC" + (org-trim (org-babel-execute-src-block))))) + (should + (equal "five 0% two\ntree 0% four" + (org-test-with-temp-text + "#+BEGIN_SRC bash :results output verbatim\necho five 0% two\necho tree 0% four\n#+END_SRC" + (org-trim (org-babel-execute-src-block)))))) + +(ert-deftest ob-shell/percent-session () + "Test percent in output for session. + +At the second iteration the string before % is dropped." + :expected-result :failed + (should + (equal "one 0% two\ntree 0% four" + (org-test-with-temp-text + "#+BEGIN_SRC bash :results output verbatim :session sess\necho one 0% two\necho tree 0% four\n#+END_SRC" + (org-trim (org-babel-execute-src-block))))) + (should + (equal "five 0% six\nseven 0% eight" + (org-test-with-temp-text + "#+BEGIN_SRC bash :results output verbatim :session sess\necho five 0% six\necho seven 0% eight\n#+END_SRC" + (org-trim (org-babel-execute-src-block)))))) + (provide 'test-ob-shell) ;;; test-ob-shell.el ends here -- 2.29.2 --=-=-=--