julia
julia copied to clipboard
REPL shell mode is incompatible with nushell
It seems that the nushell shell is incompatible with the Julia REPL at the moment. When I hit ; in the Julia REPL to open the shell, and write any command, I get this:
julia> ;
shell> echo "Hello World"
Error: nu::parser::shell_andand
× The '&&' operator is not supported in Nushell
╭─[source:1:22]
1 │ (echo 'Hello World') && true
· ─┬
· ╰── instead of '&&', use ';' or 'and'
╰────
help: use ';' instead of the shell '&&', or 'and' instead of the boolean '&&'
I think the Julia REPL should either be made compatible with nushell, or it should run commands in a compatible shell like bash. Right now I can't seem to do anything in the shell mode because my default shell is nushell.
Context: Nushell is a new type of cross-platform shell written in pure rust: https://github.com/nushell/nushell/. Instead of "&&" they use "and" (among several other differences).
I also would like to use nushell. This Discourse post says that shell mode only supports POSIX shells and that one can set the JULIA_SHELL environment variable as a workaround.
The shell> mode in the REPL doesn't actually spawn a shell, and instead evokes programs directly IIRC. How does this end up calling into nushell in the first place?
I’m not sure how it gets called. Maybe if JULIA_SHELL is unset it simply takes SHELL?
But where does the && come from? All that needs to be changed is that. Is that from run?
At the bottom of https://github.com/JuliaLang/julia/issues/23597 @xgdgsc and @stevengj were also discussing Nushell as a potential solution to having a shell mode on windows.
The shell> mode in the REPL doesn't actually spawn a shell, and instead evokes programs directly IIRC
I think the shell mode does spawn a shell. Perhaps you are thinking about run?
Anyway, a small tweak to
https://github.com/JuliaLang/julia/blob/6023ad6718514c15b3297197757ae3d93b85270b/base/client.jl#L63-L68
could probably fix this.