branch: externals/org
commit 664b23c6d9079e782423cba09208a6187815ba28
Author: Ihor Radchenko <[email protected]>
Commit: Ihor Radchenko <[email protected]>

    ob-shell: Fix detecting zsh prompts
    
    * lisp/ob-shell.el (org-babel-shell-set-prompt-commands): Add special
    setup for zsh prompts.  Disable "% +\r+" prompt.  Disable backeted
    paste delimiters.  This way, out standard echo and prompt filtering
    does not choke.
    
    Reported-by: Ravi Kiran Chilakapati <[email protected]>
    Link: https://orgmode.org/list/87frfveq2d.fsf@localhost
---
 lisp/ob-shell.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lisp/ob-shell.el b/lisp/ob-shell.el
index 239fdfb55a..e1f6b1c00b 100644
--- a/lisp/ob-shell.el
+++ b/lisp/ob-shell.el
@@ -57,6 +57,9 @@
     ("fish" . "function fish_prompt\n\techo \"%s\"\nend")
     ;; prompt2 is like PS2 in POSIX shells.
     ("csh" . "set prompt=\"%s\"\nset prompt2=\"\"")
+    ;; Disable bracketed paste - it messes up out processing and,
+    ;; apparently, comint.el.  Also, unset "%   \r" prompts.
+    ("zsh" . "setopt nopromptcr;nounset promptsp;unset 
zle_bracketed_paste;PROMPT_COMMAND=;PS1=\"%s\";PS2=")
     ;; PROMPT_COMMAND can override PS1 settings.  Disable it.
     ;; Disable PS2 to avoid garbage in multi-line inputs.
     (t . "PROMPT_COMMAND=;PS1=\"%s\";PS2="))

Reply via email to