all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#59289: Fix for clobbered output with bash sessions
@ 2022-11-15 19:38 Alice Liquori
  2022-11-16  3:30 ` Eli Zaretskii
  0 siblings, 1 reply; 2+ messages in thread
From: Alice Liquori @ 2022-11-15 19:38 UTC (permalink / raw)
  To: 59289

[-- Attachment #1: Type: text/plain, Size: 1337 bytes --]

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.

[-- Attachment #2: Type: text/html, Size: 1667 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#59289: Fix for clobbered output with bash sessions
  2022-11-15 19:38 bug#59289: Fix for clobbered output with bash sessions Alice Liquori
@ 2022-11-16  3:30 ` Eli Zaretskii
  0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2022-11-16  3:30 UTC (permalink / raw)
  To: Alice Liquori; +Cc: 59289

> 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.





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-11-16  3:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-15 19:38 bug#59289: Fix for clobbered output with bash sessions Alice Liquori
2022-11-16  3:30 ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.