branch: externals/org
commit e9c288dfaccc2960e5b6889e6aabea700ad4e05a
Author: Matthew Trzcinski <m...@excalamus.com>
Commit: Matthew Trzcinski <m...@excalamus.com>

    lisp/ob-comint.el: Fix prompt appearing in async shell results
    
    * lisp/ob-comint.el (org-babel-comint-async-filter): Call prompt
    `org-babel-comint--prompt-filter'
    
    Reported-by: "Matthew Trzcinski" <m...@excalamus.com>
    Link: 
https://list.orgmode.org/18d753c1e8a.cfb3e1921191837.5665565128507976...@excalamus.com/
---
 lisp/ob-comint.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lisp/ob-comint.el b/lisp/ob-comint.el
index d13aacccc1..f2251892a3 100644
--- a/lisp/ob-comint.el
+++ b/lisp/ob-comint.el
@@ -325,9 +325,10 @@ STRING contains the output originally inserted into the 
comint buffer."
                      until (and (equal (match-string 1) "start")
                                 (equal (match-string 2) uuid))
                      finally return (+ 1 (match-end 0)))))
-                  ;; Apply callback to clean up the result
-                  (res-str (funcall org-babel-comint-async-chunk-callback
-                                     res-str-raw)))
+                   ;; Remove prompt
+                   (res-promptless (org-trim (string-join (mapcar #'org-trim 
(org-babel-comint--prompt-filter res-str-raw)) "\n") "\n"))
+                  ;; Apply user callback
+                  (res-str (funcall org-babel-comint-async-chunk-callback 
res-promptless)))
              ;; Search for uuid in associated org-buffers to insert results
              (cl-loop for buf in org-buffers
                       until (with-current-buffer buf

Reply via email to