I tried using emacs -Q and org 9.4, and you're right, this bug is nonexistent there. I am using Doom, so that's where the bug is coming from most probably. Unfortunately, things don't work without that bug either. The evaluation hangs indefinitely. I have used C-g to cancel them and take a look at the session buffer:

```
echo $HOME $0
]2;evar@Fereidoons-MacBook-Pro: ~/cellar/notes/org ]1;..lar/notes/org
~/cellar/notes/org
❯ echo $HOME $0echo $HOME $0
echo 'org_babel_sh_eoe'
echo 'org_babel_sh_eoe'
]2;echo $HOME $0 ]1;echo /Users/evar /usr/local/bin/zsh
]2;evar@Fereidoons-MacBook-Pro: ~/cellar/notes/org ]1;..lar/notes/org
~/cellar/notes/org
❯ echo 'org_babel_sh_eoe'echo 'org_babel_sh_eoe'
]2;echo 'org_babel_sh_eoe' ]1;echo org_babel_sh_eoe
]2;evar@Fereidoons-MacBook-Pro: ~/cellar/notes/org ]1;..lar/notes/org
~/cellar/notes/org
~/cellar/notes/org master
~/cellar/notes/org master*
❯ echo $HOME $0
echo $echo 'org_babel_sh_eoe'
HOME $0
]2;echo $HOME $0 ]1;echo /Users/evar /usr/local/bin/zsh
]2;evar@Fereidoons-MacBook-Pro: ~/cellar/notes/org ]1;..lar/notes/org
~/cellar/notes/org master*
❯ echo 'org_babel_sh_eoe'echo 'org_babel_sh_eoe'
]2;echo 'org_babel_sh_eoe' ]1;echo org_babel_sh_eoe
]2;evar@Fereidoons-MacBook-Pro: ~/cellar/notes/org ]1;..lar/notes/org
~/cellar/notes/org master*
❯ echo $HOME $0
echo $echo 'org_babel_sh_eoe'
HOME $0
]2;echo $HOME $0 ]1;echo /Users/evar /usr/local/bin/zsh
]2;evar@Fereidoons-MacBook-Pro: ~/cellar/notes/org ]1;..lar/notes/org
~/cellar/notes/org master*
❯ echo 'org_babel_sh_eoe'echo 'org_babel_sh_eoe'
]2;echo 'org_babel_sh_eoe' ]1;echo org_babel_sh_eoe
]2;evar@Fereidoons-MacBook-Pro: ~/cellar/notes/org ]1;..lar/notes/org
~/cellar/notes/org master*
~/cellar/notes/org master*


]2;evar@Fereidoons-MacBook-Pro: ~/cellar/notes/org ]1;..lar/notes/org
~/cellar/notes/org master*


]2;evar@Fereidoons-MacBook-Pro: ~/cellar/notes/org ]1;..lar/notes/org
~/cellar/notes/org master*


]2;evar@Fereidoons-MacBook-Pro: ~/cellar/notes/org ]1;..lar/notes/org
~/cellar/notes/org master*


]2;evar@Fereidoons-MacBook-Pro: ~/cellar/notes/org ]1;..lar/notes/org
~/cellar/notes/org master*
❯ echo hi
echo
]2;echo hi ]1;echo hi
]2;evar@Fereidoons-MacBook-Pro: ~/cellar/notes/org ]1;..lar/notes/org
~/cellar/notes/org master*
❯ echo jk
echo
]2;echo jk ]1;echo jk
]2;evar@Fereidoons-MacBook-Pro: ~/cellar/notes/org ]1;..lar/notes/org
~/cellar/notes/org master*
❯ echo $HOME $0
echo $echo 'org_babel_sh_eoe'
HOME $0
]2;echo $HOME $0 ]1;echo /Users/evar /usr/local/bin/zsh
]2;evar@Fereidoons-MacBook-Pro: ~/cellar/notes/org ]1;..lar/notes/org
~/cellar/notes/org master*
❯ echo 'org_babel_sh_eoe'echo 'org_babel_sh_eoe'
]2;echo 'org_babel_sh_eoe' ]1;echo org_babel_sh_eoe
]2;evar@Fereidoons-MacBook-Pro: ~/cellar/notes/org ]1;..lar/notes/org
~/cellar/notes/org master*
❯ exit
exit
]2;exit ]1;exit
Process shell finished
echo $HOME $0
]2;evar@Fereidoons-MacBook-Pro: ~/cellar/notes/org ]1;..lar/notes/org
~/cellar/notes/org
❯ echo $echo 'org_babel_sh_eoe'
HOME $0
]2;echo $HOME $0 ]1;echo /Users/evar /usr/local/bin/zsh
]2;evar@Fereidoons-MacBook-Pro: ~/cellar/notes/org ]1;..lar/notes/org
~/cellar/notes/org
❯ echo 'org_babel_sh_eoe'echo 'org_babel_sh_eoe'
]2;echo 'org_babel_sh_eoe' ]1;echo org_babel_sh_eoe
]2;evar@Fereidoons-MacBook-Pro: ~/cellar/notes/org ]1;..lar/notes/org
~/cellar/notes/org
~/cellar/notes/org master
~/cellar/notes/org master*
~/cellar/notes/org master*
❯ 
```

On Sat, Aug 22, 2020 at 8:39 AM Kyle Meyer <kyle@kyleam.com> wrote:
Rudi C writes:

> #+BEGIN_SRC zsh :session z1
> echo $HOME $0
> #+END_SRC
>
> #+RESULTS:
> : /Users/evar /bin/bash

What version of Org are you using?

I tried with both the latest release (9.3.7) and the current master
branch (220f2b0d9), using default configuration aside from

    (org-babel-do-load-languages
     'org-babel-load-languages
     '((shell . t)))

I see "/usr/bin/zsh" in both cases.