Re: [BUG] org-babel-comint-with-output: incorrect prompt detection [9.6-pre]

2022-12-12 Thread Ihor Radchenko
Ihor Radchenko writes: > One possible fix could be replacing `comint-prompt-regexp' one more time > at the very end in addition to `org-babel-comint-prompt-separator'. We > must also make `comint-prompt-regexp' more precise to avoid "lude> " > being detected as a prompt. This is what I ended up

Re: [BUG] org-babel-comint-with-output: incorrect prompt detection [9.6-pre]

2022-11-12 Thread Ihor Radchenko
Bruno Barbier writes: >> We must also make `comint-prompt-regexp' more precise to avoid "lude> " >> being detected as a prompt. > If we need to do that for ob-haskell (when relying on the interpreter), > the cleanest way might be to redefine the set of possible prompts. ghci > is quite flexible:

Re: [BUG] org-babel-comint-with-output: incorrect prompt detection [9.6-pre]

2022-11-11 Thread Bruno Barbier
Ihor Radchenko writes: > The problem is that Bash can send incoming text like > > "prompt> " "prompt> " "prompt> output\n". > > "prompt> prompt> prompt> output\n". Yes. And I've seen these "outputs" with ob-haskell too ... > > So, we cannot reliably distinguish your case from other possibly

Re: [BUG] org-babel-comint-with-output: incorrect prompt detection [9.6-pre]

2022-11-10 Thread Ihor Radchenko
Bruno Barbier writes: > 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. The

[BUG] org-babel-comint-with-output: incorrect prompt detection [9.6-pre]

2022-11-10 Thread Bruno Barbier
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,