Re: [PATCH] babel output seems to drop anything before % (in session)

2022-09-24 Thread Bastien Guerry
Ihor Radchenko writes: > May you clarify if we are following the FSF copyright assignment rules > for test? Yes, we should. Tests are just source code. -- Bastien

Re: [PATCH] babel output seems to drop anything before % (in session)

2022-09-24 Thread Ihor Radchenko
Ihor Radchenko writes: > Applied onto main via a35d16368. > https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=a35d163685908386833a3d549ed110931bf3915a > > I did not do anything with Daniele's patch because it requires FSF > copyright. Bastien, If I recall correctly, our tests are

Re: [PATCH] babel output seems to drop anything before % (in session)

2022-08-26 Thread Ihor Radchenko
Ihor Radchenko writes: > I finally managed to get some working fix. > At least it kind of works on my system using bash. > The idea is changing shell prompt to something unique when we initialize > the session. > > See the attached patch. Fixed. Applied onto main via a35d16368. https://git.savan

Re: babel output seems to drop anything before % (in session)

2022-07-16 Thread Ihor Radchenko
Daniele Pizzolli writes: > 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 Daniele, your patch is over 15LOC. Would you mind doing FSF pape

[PATCH] babel output seems to drop anything before % (in session)

2022-06-17 Thread Ihor Radchenko
"Felix Freeman" writes: > Today I stumbed upon the same bug. > > Sadly I have no idea how to fix it, but thought it would be nice to post > about it here so the bug doesn't get lost in the sands of time. I finally managed to get some working fix. At least it kind of works on my system using bash

Re: babel output seems to drop anything before % (in session)

2022-06-07 Thread Felix Freeman
> (setq shell-prompt-pattern "^sh-[[:digit:]].[[:digit:]]\$ ") Updated this bit for something better written for emacs and suitable for my use cases: bash and SSH over TRAMP. I'll leave it here in case anyone else needs it in the future: (setq shell-prompt-pattern "^\\(sh-[[:digit:]]\\.[[:digit:

Re: babel output seems to drop anything before % (in session)

2022-06-07 Thread Felix Freeman
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

Re: babel output seems to drop anything before % (in session)

2022-06-07 Thread Felix Freeman
Today I stumbed upon the same bug. Sadly I have no idea how to fix it, but thought it would be nice to post about it here so the bug doesn't get lost in the sands of time. Felix Freeman

Re: babel output seems to drop anything before % (in session)

2021-11-09 Thread Ihor Radchenko
Kaushal Modi writes: > Hello all, > > I am following up on this issue with ob-shell and sessions. > > I had posted the recipe to reproduce the issue few months back, and it > still applies; ref: > https://list.orgmode.org/CAFyQvY2AeToQc2G=e+de4votetfbkvisenipypw1y-feu1o...@mail.gmail.com/ FYI, I

Re: babel output seems to drop anything before % (in session)

2021-11-09 Thread Kaushal Modi
Hello all, I am following up on this issue with ob-shell and sessions. I had posted the recipe to reproduce the issue few months back, and it still applies; ref: https://list.orgmode.org/CAFyQvY2AeToQc2G=e+de4votetfbkvisenipypw1y-feu1o...@mail.gmail.com/ Thanks! -- Kaushal Modi

Re: babel output seems to drop anything before % (in session)

2021-06-08 Thread Kaushal Modi
Hi Nick, On Tue, Jun 8, 2021 at 11:54 PM Kaushal Modi wrote: > > Thanks! I tried out your patch and it does fix the truncation of results > output. Though, it retains the shell prompt in the first eval block and > removes it only from the second eval block onwards. > I have one more feedback ab

Re: babel output seems to drop anything before % (in session)

2021-06-08 Thread Kaushal Modi
On Thu, May 6, 2021 at 7:45 PM Nick Savage wrote: > So I have a patch written that doesn't completely fix the problem, but > maybe makes enough progress that someone else can figure it out. > > The issue is that comint-prompt-regexp is reading the "% " as a prompt, > and taking everyone off befor

Re: babel output seems to drop anything before % (in session)

2021-06-08 Thread Kaushal Modi
Today I ended up on possibly a related issue with ob-shell results. Observations: 1. Issue triggered when using :session 2. Output text is OK for the the first shell src block's output. But for the second block, the output before '>' gets truncated. Here's a minimal reproducible example: = #

Re: babel output seems to drop anything before % (in session)

2021-05-15 Thread Bastien
Hi Nick, Nick Savage writes: > So I have a patch written that doesn't completely fix the problem, but > maybe makes enough progress that someone else can figure it out. I hope you can continue to make progress on this (annoying) one. Let us know! -- Bastien

Re: babel output seems to drop anything before % (in session)

2021-05-06 Thread Nick Savage
So I have a patch written that doesn't completely fix the problem, but maybe makes enough progress that someone else can figure it out. The issue is that comint-prompt-regexp is reading the "% " as a prompt, and taking everyone off before it. I've added another parameter to org-babel-comint-wi

Re: babel output seems to drop anything before % (in session)

2021-05-06 Thread Ihor Radchenko
"Nicholas Savage" writes: > I can confirm this too on the latest master. > > I took a quick peek this morning, and my suspicion is that the problem is > somewhere within org-babel-comint-with-output in lisp/ob-comint.el, but I'm > not positive at this point. I confirm as well. I also saw an an

Re: babel output seems to drop anything before % (in session)

2021-05-06 Thread Nicholas Savage
I can confirm this too on the latest master. I took a quick peek this morning, and my suspicion is that the problem is somewhere within org-babel-comint-with-output in lisp/ob-comint.el, but I'm not positive at this point. On Wed, May 5, 2021, at 22:35, John Corless wrote: > Confirmed > > Dani

Re: babel output seems to drop anything before % (in session)

2021-05-05 Thread John Corless
Confirmed Daniele, I was able to reproduce the behavior you described. Using the test case... #+BEGIN_SRC shell script :results output ping -c 1 127.0.0.1 #+END_SRC ... the results output matches what I get in a bash shell. But if you add the :session to the header args like this... #+BEGIN_

babel output seems to drop anything before % (in session)

2021-05-05 Thread Daniele Pizzolli
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