0

I am having troubles with the output of a fish session in org-babel. It seems to be related to the bracketed paste, but only happens when :session is used. I was wondering if there is any way to clean up the repeated lines produced within the shell session associated (its contents are below). I searched all over the internet but documentation exists for each component (org-babel session, fish and bracketed paste), but not for their usage in tandem. If anyone has a clue of why could org-babel be failing to filter-out all lines that would be greatly appreciated.

Edit: Just to add a bit of context, I am using doom-emacs, but that does not seem to be related to the problem.

#+begin_src shell
echo "tmp"
#+end_src

#+RESULTS:
: tmp

#+begin_src shell :session var :results output raw
set VAR "tmp"
echo $VAR
#+end_src

#+RESULTS:
set VAR 
$ set VAR "tmp"
$ set VAR "tmp"
echo
echo $VAR
$ echo $VAR
[?2004ltmp
echo

Shell session buffer:

$ set VAR "tmp"
$ echo $VAR
tmp
$ echo 'org_babel_sh_eoe'
org_babel_sh_eoe
4
  • If it works on its own (outside of org-babel) then I would guess that the matching of the prompt that allows org-babel to figure out what is a prompt and what is a command, is failing. Please report it with M-x org-submit-bug-report. EDIT: I can reproduce it too. It's almost certainly a bug.
    – NickD
    Sep 26, 2023 at 10:33
  • BTW, what "bracketed paste" are you talking about?
    – NickD
    Sep 26, 2023 at 17:19
  • I've done a bit more digging and it has to do with the dumb terminal printing the input twice. It does not seem related to bracketed paste in the end, but there is the link in case that it is useful. I will report the bug. In the meantime, I just silence the output of executing cells and use the inferior prompt manually, thanks anyways!
    – barbacoa
    Sep 28, 2023 at 13:55
  • Thanks for the link! TIL...
    – NickD
    Sep 28, 2023 at 13:58

1 Answer 1

0

Try to specify the language as fish, rather than shell. Also, check if fish is supported by babel by checking the value of the variable org-babel-shell-names.

2
  • 1
    This is probably not an answer (it could be a comment), but it is useful: specifying fish as the language changes the output to nothing in my experiment. That's still wrong but it is different, so it might provide an additional clue. fish has been included in org-babel-shell-names since Dec. 2018 (AFAICT - it was added in version 9.2), so that is unlikely to be a problem. In any case, I still can reproduce the problem even on latest.
    – NickD
    Sep 26, 2023 at 11:51
  • Yes, I can confirm that this persists for shell, bash and fish.
    – barbacoa
    Sep 28, 2023 at 13:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.