# Can the Julia shell be changed to \`/bin/bash\`?

**URL:** <https://discourse.julialang.org/t/can-the-julia-shell-be-changed-to-bin-bash/122500>\
**Category:** New to Julia\
**Tags:** question, shell\
**Created:** [November 11, 2024, 2:54pm UTC](https://discourse.julialang.org/t/can-the-julia-shell-be-changed-to-bin-bash/122500 "2024-11-11T14:54:04Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [November 11, 2024, 3:07pm UTC](https://discourse.julialang.org/t/can-the-julia-shell-be-changed-to-bin-bash/122500/2 "2024-11-11T15:07:29Z")

</div>

> [@world-peace](#):
>
> Can the default shell be changed so that a `/bin/bash` shell is launched when the Shell Mode key `;` is pressed?

I suppose it _could_. This IS by design, as I explained in the other answer, to be cross-platform. You can’t rely on e.g. `bash` installed, or any shell even `sh`; you might even run on a platform with no shell (all supported platforms have _some_ shells, at least Windows with `cmd`, I mean just in theory some [future, e.g. a microcontroller] might have none available), i.e. no specific shell is preinstalled on all of Julia’s supported platforms. E.g. not `bash` on Windows (though by now with WSL2, wasn’t available when Julia was designed), and PowerShell _not by default_ on Linux (but IS available there). Julia doesn’t want to bundle a shell (nor a terminal) with, making julia even larger, so it supports some common subset working on all platforms.

Note there is ReplMaker.jl that people have used to make their own modes (such as **[SQLREPL.jl](https://github.com/c42f/SQLREPL.jl)** that I nerdsniped into existence), in addition to `;` for the default shell mode (I’m not sure it allows changing a specific mode, maybe it does, at least an improved mode could be prototyped with it).

Basically anything is possible in Julia, i.e. is dynamic, so you could even change the default shell [code to do anything, such as you ask for], to e.g. call bash, or PowerShell, such a package could even bundle either (or both!). I don’t know that anyone has done this, and you might not use that tool to do it, except to prototype at first.

> [@world-peace](#):
>
> Someone can tell me if there’s an obvious reason why Julia has its own shell rather than using a native OS one, if there is a reason for it which I’ve overlooked.

It’s for quick ls, dir, etc. Note on Windows you have dir not ls (at least historically), and vice versa. I see I actually have dir also in Mint (and any Linux, e.g. Ubuntu) by now. If I recall Julia may support ls even when absent on Windows.

EDIT: I see `dir` does NOT actually work (or docs outdated? would with PowerShell?) on Windows (neither ls?):

> **[The Julia REPL · The Julia Language](https://docs.julialang.org/en/v1/stdlib/REPL/#man-shell-mode)**
>
> Documentation for The Julia Language.

> For Windows users, Julia’s shell mode does not expose windows shell commands. Hence, this will fail:

> [@Documentation for shell mode?](https://discourse.julialang.org/t/documentation-for-shell-mode/55564/2):
>
> 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

> <https://github.com/JuliaLang/julia/blob/f93138ed0791799bf4bd33649cb3269054474a24/stdlib/REPL/src/REPL.jl#L814-L814>

I see some code specific for ~ on Unix/Linux and some Windows specific too:

> <https://github.com/JuliaLang/julia/blob/f93138ed0791799bf4bd33649cb3269054474a24/stdlib/REPL/src/REPLCompletions.jl#L473-L473>

> <https://github.com/JuliaLang/julia/pull/33827/files#diff-d48b8f45e044ee1cbdfefdf19a41cc647cb962e0ef8f0b211c98aa786229abfb>
>
> @staticfloat I think this might be more reliable (closer to what the internal co…de does)?

---

_[View the full topic](https://discourse.julialang.org/t/can-the-julia-shell-be-changed-to-bin-bash/122500)._
