emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] babel runs bash instead of zsh when sessions are used
@ 2020-08-19 16:01 Rudi C
  2020-08-22  4:09 ` Kyle Meyer
  0 siblings, 1 reply; 5+ messages in thread
From: Rudi C @ 2020-08-19 16:01 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 176 bytes --]

#+BEGIN_SRC zsh :session z1
echo $HOME $0
#+END_SRC

#+RESULTS:
: /Users/evar /bin/bash

As compared to:

#+BEGIN_SRC zsh
echo $HOME $0
#+END_SRC

#+RESULTS:
: /Users/evar zsh

[-- Attachment #2: Type: text/html, Size: 2674 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [BUG] babel runs bash instead of zsh when sessions are used
  2020-08-19 16:01 [BUG] babel runs bash instead of zsh when sessions are used Rudi C
@ 2020-08-22  4:09 ` Kyle Meyer
  2020-08-22 13:10   ` Rudi C
  2020-08-24 16:13   ` Nick Dokos
  0 siblings, 2 replies; 5+ messages in thread
From: Kyle Meyer @ 2020-08-22  4:09 UTC (permalink / raw)
  To: Rudi C; +Cc: emacs-orgmode

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.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [BUG] babel runs bash instead of zsh when sessions are used
  2020-08-22  4:09 ` Kyle Meyer
@ 2020-08-22 13:10   ` Rudi C
  2020-08-24 16:13   ` Nick Dokos
  1 sibling, 0 replies; 5+ messages in thread
From: Rudi C @ 2020-08-22 13:10 UTC (permalink / raw)
  To: Kyle Meyer; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 4083 bytes --]

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.
>

[-- Attachment #2: Type: text/html, Size: 4931 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [BUG] babel runs bash instead of zsh when sessions are used
  2020-08-22  4:09 ` Kyle Meyer
  2020-08-22 13:10   ` Rudi C
@ 2020-08-24 16:13   ` Nick Dokos
  2020-08-25  0:42     ` Kyle Meyer
  1 sibling, 1 reply; 5+ messages in thread
From: Nick Dokos @ 2020-08-24 16:13 UTC (permalink / raw)
  To: emacs-orgmode

Kyle Meyer <kyle@kyleam.com> writes:

> 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.
>
>

I was able to reproduce it (with ksh, rather than zsh) on Org mode version 9.3.7 (release_9.3.7-705-gea9463 @ /home/nick/elisp/org-mode/lisp/).

--8<---------------cut here---------------start------------->8---
#+BEGIN_SRC ksh :session z1
echo $HOME $0 $(which $0)
#+END_SRC

#+RESULTS:
: /home/nick /bin/bash /bin/bash

#+BEGIN_SRC ksh
echo $HOME $0 $(which $0)
#+END_SRC

#+RESULTS:
: /home/nick ksh /usr/bin/ksh

--8<---------------cut here---------------end--------------->8---

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [BUG] babel runs bash instead of zsh when sessions are used
  2020-08-24 16:13   ` Nick Dokos
@ 2020-08-25  0:42     ` Kyle Meyer
  0 siblings, 0 replies; 5+ messages in thread
From: Kyle Meyer @ 2020-08-25  0:42 UTC (permalink / raw)
  To: Nick Dokos; +Cc: emacs-orgmode

Nick Dokos writes:

> I was able to reproduce it (with ksh, rather than zsh) on Org mode version 9.3.7 (release_9.3.7-705-gea9463 @ /home/nick/elisp/org-mode/lisp/).
>
> --8<---------------cut here---------------start------------->8---
> #+BEGIN_SRC ksh :session z1
> echo $HOME $0 $(which $0)
> #+END_SRC
>
> #+RESULTS:
> : /home/nick /bin/bash /bin/bash


Hmm.  If you step through org-babel-execute:shell, is shell-file-name
bound to the expected value of "ksh" (which should be let-bound outside
by org-babel-execute:ksh)?


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-08-25  0:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-19 16:01 [BUG] babel runs bash instead of zsh when sessions are used Rudi C
2020-08-22  4:09 ` Kyle Meyer
2020-08-22 13:10   ` Rudi C
2020-08-24 16:13   ` Nick Dokos
2020-08-25  0:42     ` Kyle Meyer

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).