I really like the REPL’s shell mode (the thing you get after typing ;). But I struggle with understanding which features of my normal $SHELL are available, and which don’t work. I’ve read the official docs, but I can’t find the answers to these questions:
Why aren’t the aliases I define in my e.g. ~/.zshrc available?
Can I do any job control (run things in the background with &, etc.)?
Why can’t I set shell variables?
Is there anywhere I can find the answers to this questions?
I run Julia on Linux if it matters, and I use zsh as my shell.
Julia shell is not really using *your shell. In fact, it’s not running a shell at all, for example, ls * doesn’t work because * is expanded by shell program (bash, zsh) and Julia is not using any of them.
you can, however, run zsh as the first thing at shell > and that will drop you into your zsh. But I don’t think that is a particularly useful workflow, you might as well just Ctrl-Z the Julia instead
julia> run(`ls *`)
ERROR: LoadError: parsing command `ls *`: special characters "#{}()[]<>|&*?~;" must be quoted in commands
Stacktrace:
julia> run(`ls \*`)
ls: cannot access '*': No such file or directory
ERROR: failed process: Process(`ls '*'`, ProcessExited(2)) [2]
It’s passing * to ls just fine, but you have to realize that ls doesn’t know what to do with *. In a shell like bash, when you execute ls *, shell expands the * before passing arguments to ls. Julia shell doesn’t do that, it passes the argument (*) to ls directly – because Julia is not running a shell for you.
To further demonstrate this point, the following works by invoking a shell that expands *: