# How do you use the shell from the interpreter? Is this correct?

**URL:** <https://discourse.julialang.org/t/how-do-you-use-the-shell-from-the-interpreter-is-this-correct/2044>\
**Category:** New to Julia\
**Tags:** windows\
**Created:** [February 11, 2017, 5:29pm UTC](https://discourse.julialang.org/t/how-do-you-use-the-shell-from-the-interpreter-is-this-correct/2044 "2017-02-11T17:29:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![w1res](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/w1res/32/588_2.png) [@w1res](https://discourse.julialang.org/u/w1res)\
**Post date:** [February 11, 2017, 5:29pm UTC](https://discourse.julialang.org/t/how-do-you-use-the-shell-from-the-interpreter-is-this-correct/2044/1 "2017-02-11T17:29:06Z")

</div>

I’m using Julia 0.5.0 on Windows 7, and having some issues with doing shell commands in REPL.

I use the desktop shortcut to launch Julia, then type a semicolon and the prompt changes to `shell>`. Then I type `dir`, which on Windows, should list the contents of the directory. Instead, I get the following error.

```julia
shell> DIR
ERROR: could not spawn `DIR`: no such file or directory (ENOENT)
 in _jl_spawn(::String, ::Array{String,1}, ::Ptr{Void}, ::Base.Process, ::RawFD, ::RawFD, ::RawFD) at .\process.jl:321
 in #414 at .\process.jl:478 [inlined]
 in setup_stdio(::Base.##414#415{Cmd,Ptr{Void},Base.Process}, ::Tuple{RawFD,RawFD,RawFD}) at .\process.jl:466
 in #spawn#413(::Nullable{Base.ProcessChain}, ::Function, ::Cmd, ::Tuple{RawFD,RawFD,RawFD}, ::Bool, ::Bool) at .\process.jl:477
 in run(::Cmd) at .\process.jl:591
 in repl_cmd(::Cmd, ::Base.Terminals.TTYTerminal) at .\client.jl:91

```

As I’m a beginner at Julia, I’m not quite sure what to make of the error message.

---

<div class="post-metadata">

**Author:** ![tkelman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkelman/32/692_2.png) [@tkelman](https://discourse.julialang.org/u/tkelman)\
**Post date:** [February 11, 2017, 6:39pm UTC](https://discourse.julialang.org/t/how-do-you-use-the-shell-from-the-interpreter-is-this-correct/2044/2 "2017-02-11T18:39:30Z")

</div>

`dir` isn’t an executable, it’s a cmd shell built-in. “shell mode” on windows doesn’t go through the cmd interpreter, since that has so many corner cases it’s not really worth the implementation complexity. You could prefix everything with `powershell` which is probably a bit more useful.

---

<div class="post-metadata">

**Author:** ![w1res](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/w1res/32/588_2.png) [@w1res](https://discourse.julialang.org/u/w1res)\
**Post date:** [February 11, 2017, 6:54pm UTC](https://discourse.julialang.org/t/how-do-you-use-the-shell-from-the-interpreter-is-this-correct/2044/3 "2017-02-11T18:54:58Z")

</div>

Ah I see. Thanks for the clarification!

---

<div class="post-metadata">

**Author:** ![greg\_plowman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/greg_plowman/32/8100_2.png) [@greg\_plowman](https://discourse.julialang.org/u/greg_plowman)\
**Post date:** [February 13, 2017, 1:19pm UTC](https://discourse.julialang.org/t/how-do-you-use-the-shell-from-the-interpreter-is-this-correct/2044/4 "2017-02-13T13:19:58Z")

</div>

Would it be possible for Julia to detect whether `powershell ` is available, and if so, use it as the default shell?

---

<div class="post-metadata">

**Author:** ![tkelman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkelman/32/692_2.png) [@tkelman](https://discourse.julialang.org/u/tkelman)\
**Post date:** [February 13, 2017, 1:27pm UTC](https://discourse.julialang.org/t/how-do-you-use-the-shell-from-the-interpreter-is-this-correct/2044/5 "2017-02-13T13:27:10Z")

</div>

Powershell should always be available since vista. It has a rather unfortunate first-time startup delay which is the main reason past PR’s to make it the default didn’t get very far. I’d encourage someone to develop a package for a powershell repl mode. There’s an open base issue on making repl mode extension mechanisms more official and able to coexist in a nicer way via a switcher menu rather than having to fight over keys.
