Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shell is broken in the REPL #22464

Closed
ZacCranko opened this issue Jun 21, 2017 · 11 comments
Closed

Shell is broken in the REPL #22464

ZacCranko opened this issue Jun 21, 2017 · 11 comments

Comments

@ZacCranko
Copy link

The shell is broken in the Julia REPL here.

784f43a0c033:~ zcrank$ julia
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: https://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.6.0 (2017-06-19 13:05 UTC)
 _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org/ release
|__/                   |  x86_64-apple-darwin13.4.0

shell> ls
ERROR: could not spawn `/bin/false -i -c '(ls) && true'`: no such file or directory (ENOENT)
Stacktrace:
 [1] _jl_spawn(::String, ::Array{String,1}, ::Ptr{Void}, ::Base.Process, ::RawFD, ::RawFD, ::RawFD) at ./process.jl:360
 [2] #373 at ./process.jl:512 [inlined]
 [3] setup_stdio(::Base.##373#374{Cmd}, ::Tuple{RawFD,RawFD,RawFD}) at ./process.jl:499
 [4] #spawn#372(::Nullable{Base.ProcessChain}, ::Function, ::Cmd, ::Tuple{RawFD,RawFD,RawFD}) at ./process.jl:511
 [5] run(::Cmd) at ./process.jl:650
 [6] repl_cmd(::Cmd, ::Base.Terminals.TTYTerminal) at ./client.jl:111

The problem seems to be because Julia is looking for true and false at the location /bin, when on this machine they're stored at

784f43a0c033:~ zcrank$ which false
/usr/bin/false
784f43a0c033:~ zcrank$ which true
/usr/bin/true

I'm running macOS 10.12.1. This is an Amazon-imaged machine, so there might have been some messing with the paths of things.

@DrKrar
Copy link
Contributor

DrKrar commented Jun 21, 2017

I have a same issue on windows 10.

shell> ls
ERROR: could not spawn ls: no such file or directory (ENOENT)

@kshyatt kshyatt added the REPL Julia's REPL (Read Eval Print Loop) label Jun 21, 2017
@tkelman
Copy link
Contributor

tkelman commented Jun 22, 2017

There is no ls on the path on windows generally, so that's a different and expected issue.

@otaithleigh
Copy link

@tkelman There is if you're using PowerShell. But using CMD or PS, I have the same issue.

C:\Users\peter>julia
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: https://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.6.0 (2017-06-19 13:05 UTC)
 _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org/ release
|__/                   |  x86_64-w64-mingw32

shell> dir
ERROR: could not spawn `dir`: no such file or directory (ENOENT)
Stacktrace:
 [1] _jl_spawn(::String, ::Array{String,1}, ::Ptr{Void}, ::Base.Process, ::RawFD, ::RawFD, ::RawFD) at .\process.jl:360
 [2] #375 at .\process.jl:512 [inlined]
 [3] setup_stdio(::Base.##375#376{Cmd}, ::Tuple{RawFD,RawFD,RawFD}) at .\process.jl:499
 [4] #spawn#374(::Nullable{Base.ProcessChain}, ::Function, ::Cmd, ::Tuple{RawFD,RawFD,RawFD}) at .\process.jl:511
 [5] run(::Cmd) at .\process.jl:650
 [6] repl_cmd(::Cmd, ::Base.Terminals.TTYTerminal) at .\client.jl:111

@vtjnash
Copy link
Member

vtjnash commented Jun 22, 2017

@otaithleigh That is expected: windows doesn't provide a dir program

@otaithleigh
Copy link

@vtjnash It does; it's the CMD version of ls.
https://en.wikipedia.org/wiki/Dir_(command)

@yuyichao
Copy link
Contributor

It's an internal command, not a program.

@yuyichao
Copy link
Contributor

yuyichao commented Jun 22, 2017

This isn't really a julia issue. There's no direct reference of /bin/false and it comes from your shell setting. People expect the shell mode to be as close as possible to their shell so I think it's fair to give a broken shell mode if you have a broken shell. Setting JULIA_SHELL or SHELL to a correct value should fix this.

@yuyichao yuyichao removed the REPL Julia's REPL (Read Eval Print Loop) label Jun 22, 2017
@wr125
Copy link

wr125 commented Jun 22, 2017

Same here, great advice; "People expect the shell mode to be as close as possible to their shell so I think it's fair to give a broken shell mode if you have a broken shell. Setting JULIA_SHELL or SHELL to a correct value should fix this." Which folder reference do we change exactly on windows (by renaming bin folder with src?). Many thanks in advance.

(Julia Terminal - below message)

Julia>
2017-06-22T16:48:43.797 - info: Finished adding dependencies


2017-06-22T16:48:43.797 - info: Starting your brand new Genie app - hang tight!

ERROR: could not spawn `bin/repl`: 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 #426 at .\process.jl:478 [inlined]
 in setup_stdio(::Base.##426#427{Cmd,Ptr{Void},Base.Process}, ::Tuple{RawFD,RawFD,RawFD}) at .\process.jl:466
 in #spawn#425(::Nullable{Base.ProcessChain}, ::Function, ::Cmd, ::Tuple{RawFD,RawFD,RawFD}, ::Bool, ::Bool) at .\process.jl:477
 in run(::Cmd) at .\process.jl:591
 in run_repl_app at C:\JuliaPro-0.5.2.2\pkgs-0.5.2.2\v0.5\Genie\src\REPL.jl:50 [inlined]
 in #new_app#1(::Bool, ::Bool, ::Function, ::String) at C:\JuliaPro-0.5.2.2\pkgs-0.5.2.2\v0.5\Genie\src\REPL.jl:37
 in new_app(::String) at C:\JuliaPro-0.5.2.2\pkgs-0.5.2.2\v0.5\Genie\src\REPL.jl:23

Julia>

@tkelman
Copy link
Contributor

tkelman commented Jun 22, 2017

@wr125 that looks like a separate issue that should be opened on the Genie.jl issue tracker, it has likely not been tested on Windows.

@yuyichao
Copy link
Contributor

Please do not report unrelated issues here....

FWIW, there are 3 different windows issues reported here, none of which has anything to do with the original issue. In fact, due to the broken state of cmd on windows we don't even use a shell wrapper and the issue here currently cannot happen on windows............

@wr125
Copy link

wr125 commented Jun 22, 2017

Figured the issue I'm experiencing is not with "PowerShell" but with configuring the installation of Genie within the Juno/Julia environment. Moving this concern over GenieFramework/Genie.jl#24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants