emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: org-babel-execute-src-block filters characters from :session *shell*


From: Ihor Radchenko
Subject: RE: org-babel-execute-src-block filters characters from :session *shell* output
Date: Wed, 19 Jun 2024 14:40:31 +0000

"Cook, Malcolm" <MEC@stowers.org> writes:

> Since my (bash) shell prompt is a (more or less) constant string (e.g. 
> "myname@myhost> ").
>
> So, my workaround is to:
>
>     (setq comint-prompt-regexp "myname@myhost> ")
>
> Then the filtering works perfectly.
>
> Of course if I change my name, this will fail.  Or, more likely, connect to a 
> different host within the shell.
>
> Or if I change PS1 😉
>
> It would be useful to automate this a little.

There is internal buffer-local variable called
`org-babel-comint-prompt-regexp-old'. If you set it to the default
`comint-prompt-regexp', Org will attempt to use it if no prompt is
detected for longer than `org-babel-comint-fallback-regexp-threshold'
seconds.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]