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

REPL shell mode IOError when changing directories #28624

Closed
CiaranOMara opened this issue Aug 13, 2018 · 4 comments · Fixed by #28635
Closed

REPL shell mode IOError when changing directories #28624

CiaranOMara opened this issue Aug 13, 2018 · 4 comments · Fixed by #28635
Labels
upstream The issue is with an upstream dependency, e.g. LLVM

Comments

@CiaranOMara
Copy link

Julia's REPL shell mode produces an error when executing a basic cd command when the default shell is fish and has the bobthefish theme active. The theme displays and formats some useful information.

The error does not occur when the default shell is /bin/bash.

               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.0.0 (2018-08-08)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> versioninfo()
Julia Version 1.0.0
Commit 5d4eaca0c9 (2018-08-08 20:58 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin14.5.0)
  CPU: Intel(R) Core(TM) i7-4960HQ CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.0 (ORCJIT, haswell)

shell> cd
/Users/me

shell> cd Do
Documents/ Downloads/
shell> cd Documents/
ERROR: IOError: chdir 7878: no such file or directory (ENOENT)
Stacktrace:
 [1] uv_error at ./libuv.jl:85 [inlined]
 [2] cd(::String) at ./file.jl:76
 [3] repl_cmd(::Cmd, ::REPL.Terminals.TTYTerminal) at ./client.jl:61
 [4] top-level scope at none:0

julia> pwd()
"/Users/me"

shell> pwd
/Users/me

julia> cd("Documents")

julia> pwd()
"/Users/me/Documents"

shell> pwd
/Users/me/Documents

julia> 
@favba
Copy link
Contributor

favba commented Aug 13, 2018

I experience the same error using fish as default shell. I don't have this bobthefish theme installed, so it seems to be some problem with fish shell alone.

@favba
Copy link
Contributor

favba commented Aug 13, 2018

This seems to be the culprit (I have no idea what is the need for that line...):

dir = read(`$shell -c "printf %s $(shell_escape_posixly(dir))"`, String)

on fish:

~> printf %s "/home"
74883

bash:

bash-3.2$ printf %s "/home"
/home

Now, if we change the command a bit, it works on both shells (and this is the way I see it done more often)

on fish:

~> printf "%s" "/home"
/home

bash:

bash-3.2$ printf "%s" "/home"
/home

I opened an issue for fish to see if this is a bug from fish.

favba added a commit to favba/julia that referenced this issue Aug 13, 2018
@favba
Copy link
Contributor

favba commented Aug 13, 2018

This is fixed on fish master and will be released only for fish 3.0, which I don't know when will be released. I made a PR here to make it work...

@KristofferC KristofferC added the upstream The issue is with an upstream dependency, e.g. LLVM label Aug 13, 2018
@CiaranOMara
Copy link
Author

Thank you @favba.

stevengj pushed a commit that referenced this issue Aug 16, 2018
KristofferC pushed a commit that referenced this issue Aug 19, 2018
(cherry picked from commit 2715fb2)
KristofferC pushed a commit that referenced this issue Aug 19, 2018
(cherry picked from commit 2715fb2)
KristofferC pushed a commit that referenced this issue Aug 19, 2018
(cherry picked from commit 2715fb2)
KristofferC pushed a commit that referenced this issue Sep 8, 2018
(cherry picked from commit 2715fb2)
KristofferC pushed a commit that referenced this issue Sep 8, 2018
(cherry picked from commit 2715fb2)
KristofferC pushed a commit that referenced this issue Feb 11, 2019
(cherry picked from commit 2715fb2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream The issue is with an upstream dependency, e.g. LLVM
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants