Hello,

I have the following org file, and I'd like to understand this
behavior better. Specifically, I'm curious why my `#+RESULTS:` blocks
only returns the output when I use `sh` code blocks, as opposed to
when I use `shell` or `zsh`.

I already [saw this
post](https://mail.gnu.org/archive/html/emacs-orgmode/2023-03/msg00376.html)
from Matt which says that `shell` was not intended to be supported,
and was an unintended consequence. So I can change my workflow if we
wanna skip that. But, I want to use `shell` code blocks for simple
commands (listing aws S3 buckets, ls, nslookup etc.) that I know will
run in almost any POSIX shell, without having to worry about what
shell I'm actually on. This is especially useful when I want to share
my org notebooks with others.

I've included the contents of the session buffers down below as well.
I find the extra outputs for
`org_babel_sh_eoe` interesting, though I don't know elisp sufficiently
well to try and debug what's happening here.

Regards,
Ravi.

## fsxn.org
```
#+property: header-args:sh+ :session fsxn-sh :results output
#+property: header-args:shell+ :session fsxn-shell :results output
#+property: header-args:zsh+ :session fsxn-zsh :results output

#+BEGIN_SRC sh
echo $SHELL
#+END_SRC

#+RESULTS:
: /bin/zsh

#+begin_src shell
echo $SHELL
#+end_src

#+RESULTS:

#+BEGIN_SRC zsh
echo $SHELL
#+END_SRC

#+RESULTS:

```
## fsxn-sh
```
sh-5.2$ PROMPT_COMMAND=;PS1="org_babel_sh_prompt> ";PS2=
org_babel_sh_prompt> echo $SHELL
echo 'org_babel_sh_eoe'
/bin/zsh
org_babel_sh_prompt> org_babel_sh_eoe
```

## fsxn-shell
```
user@host:~/Developer/workspace/org/roam/ >
PROMPT_COMMAND=;PS1="org_babel_sh_prompt> ";PS2=
g/roam/ > PROMPT_COMMAND=;PS1="org_babel_sh_prompt> ";PS2=
org_babel_sh_prompt> echo $SHELL
echo 'org_babel_sh_eoe'
echo $SHELL
/bin/zsh
org_babel_sh_prompt> echo 'org_babel_sh_eoe'
org_babel_sh_eoe
```

## fsxn-zsh
```
user@host:~/Developer/workspace/org/roam/ >
PROMPT_COMMAND=;PS1="org_babel_sh_prompt> ";PS2=
g/roam/ > PROMPT_COMMAND=;PS1="org_babel_sh_prompt> ";PS2=
org_babel_sh_prompt> echo $SHELL
echo 'org_babel_sh_eoe'
echo $SHELL
/bin/zsh
org_babel_sh_prompt> echo 'org_babel_sh_eoe'
org_babel_sh_eoe
```

## Relevant sections from config.org
```
(org-babel-do-load-languages 'org-babel-load-languages '(
                                                           (shell . t)))
(setq treesit-language-source-alist
   '((bash "https://github.com/tree-sitter/tree-sitter-bash";)
     (zsh "https://github.com/tree-sitter-grammars/tree-sitter-zsh";))
```

Reply via email to