[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#59289: Fix for clobbered output with bash sessions
From: |
Eli Zaretskii |
Subject: |
bug#59289: Fix for clobbered output with bash sessions |
Date: |
Wed, 16 Nov 2022 05:30:43 +0200 |
> From: Alice Liquori <aliquori@sig-gis.com>
> Date: Tue, 15 Nov 2022 14:38:54 -0500
>
> I ran into an issue with bash blocks that use a session where
> 'org_babel_sh_prompt> ' is strewn throughout
> the output. For large blocks the intended output can be completely buried.
> Here is an example.
>
> #+begin_src bash :session test :results output
> echo "hello"
> #+end_src
>
> #+RESULTS:
> : org_babel_sh_prompt> org_babel_sh_prompt> org_babel_sh_prompt>
> org_babel_sh_prompt> hello
>
> This is caused by a leading carat and a space before an asterisk in the
> `comint-prompt-regexp` regex in
> `org-babel-sh-initiate-session` in `ob-shell.el`, and the fix is incredibly
> simple.
>
> Here is the diff that I've generated.
>
> --- ob-shell-old.el 2022-11-15 14:29:34.351598206 -0500
> +++ ob-shell-new.el 2022-11-15 14:31:28.416924869 -0500
> @@ -255,8 +255,7 @@
> (current-buffer)
> (format org-babel-prompt-command org-babel-sh-prompt))
> (setq-local comint-prompt-regexp
> - (concat "^" (regexp-quote org-babel-sh-prompt)
> - " *"))
> + (concat (regexp-quote org-babel-sh-prompt) "*"))
> ;; Needed for Emacs 23 since the marker is initially
> ;; undefined and the filter functions try to use it without
> ;; checking.
>
> This is my first OSS contribution, I tried to follow the guidelines on
> sending patches. Let me know if there are
> any issues.
Thanks, but I think this should be reported to the Org developers, not
here.