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

0.3.1 ERROR: dangling backslash #8483

Closed
dhoegh opened this issue Sep 26, 2014 · 15 comments · Fixed by #8693
Closed

0.3.1 ERROR: dangling backslash #8483

dhoegh opened this issue Sep 26, 2014 · 15 comments · Fixed by #8693
Labels
kind:regression Regression in behavior compared to a previous version system:windows Affects only Windows

Comments

@dhoegh
Copy link
Contributor

dhoegh commented Sep 26, 2014

I have just updated to 0.3.1 and when I am in shell mode the console auto completes with \ on windows which gives an error, see log:

shell> cd Do
Documents\ Downloads\
julia> versioninfo()
Julia Version 0.3.1
Commit c03f413* (2014-09-21 21:30 UTC)
Platform Info:
  System: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7-2630QM CPU @ 2.00GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)
  LAPACK: libopenblas
  LIBM: libopenlibm
  LLVM: libLLVM-3.3
@ivarne ivarne added system:windows Affects only Windows kind:regression Regression in behavior compared to a previous version labels Sep 26, 2014
@ivarne
Copy link
Sponsor Member

ivarne commented Sep 26, 2014

Might have been introduced in #8122?
cc @tkelman and @lucasb-eyer

@tkelman
Copy link
Contributor

tkelman commented Sep 26, 2014

I suspect it's the joinpath(file,"") from 8a0f6aa, may want to just replace that with file * "/". Will test that later this afternoon. You don't mean it's erroring and closing the repl, do you? That's what was happening before that commit.

@dhoegh
Copy link
Contributor Author

dhoegh commented Sep 26, 2014

No, it just auto completes with backlash and when you hit enter then the error occurs.

@lucasb-eyer
Copy link
Contributor

Could you show us the actual error message, and give detailed steps to reproduce?

@dhoegh
Copy link
Contributor Author

dhoegh commented Sep 26, 2014

If you stand in your home dir write:
Dow # hit tab, then it auto completes to:
Downloads
hit enter then you get error.

@lucasb-eyer
Copy link
Contributor

Adding the trailing slash for folders is by design, so one can keep tabbing further down the hierarchy. I think that behavior was the same before my commits #8122 ; has this not happened before 3.1?

On linux, cd foo/ is not a problem, so I guess it's a windows thing, don't have Julia there though.

@dhoegh
Copy link
Contributor Author

dhoegh commented Sep 26, 2014

The problem is that it's a backlash and yes I think it's a windows problem.

@tkelman
Copy link
Contributor

tkelman commented Sep 26, 2014

@dhoegh please try to report the entire error message in the future whoops it's in the subject, sorry I'm blind. I built release-0.3, it looks like the error is "dangling backslash" which makes sense. If you manually type a second backslash then additional tab-completion to deeper subfolders works fine. Although joinpath("Downloads","") returns "Downloads\\" so maybe something is getting double-escaped somewhere?

@dhoegh
Copy link
Contributor Author

dhoegh commented Sep 26, 2014

I will do that, but the actual problem is that it auto completes with backlash, 0.3 auto completes with frontslash which is the correct behavior.

@tkelman
Copy link
Contributor

tkelman commented Sep 26, 2014

0.3.0 also crashes the repl if you do C:\\<tab>, so we shouldn't directly revert anything. I'm not sure which commit changed the behavior from front slash to backslash. Arguably for Windows the correct behavior would be completing with double-backslash, but forward slash should work too in the vast majority of cases.

@dhoegh
Copy link
Contributor Author

dhoegh commented Sep 26, 2014

I would agree that the correct behavior would be to have backlash between folders but it does not work when the repl is in shell mode.

@lucasb-eyer
Copy link
Contributor

Could the reason for double-escape be that I changed matches' type from ByteString[] to UTF8String[] in 47d3ecf? If so, that'd be very "magic" behavior and we should add a comment when switching back to ByteString[].

@dhoegh
Copy link
Contributor Author

dhoegh commented Oct 13, 2014

I have looked more into the problem and i have come so far that it is in the Base.REPLCompletions.shell_completions function se the following.
In Julia 0.3 i get:

julia> Base.REPLCompletions.shell_completions("cd Docume",7)
(ASCIIString["Documents/"],4:7,true)
julia> Base.REPLCompletions.complete_path("Docume")
1-element Array{Union(ASCIIString,UTF8String),1}:
 "Documents\\"

0.3 completes with a front slash and 0.4 does this:

julia> Base.REPLCompletions.shell_completions("cd Docume",7)
(UTF8String["Documents\\"],4:7,true)
julia> Base.REPLCompletions.complete_path("Docume",6)
(UTF8String["Documents\\"],1:6,true)

The problem here is not only that it only completes with one backslash but also the following behavior:

cd Documents\\<tab><tab>

Then I get the completion equivalent to C:\\ which is not the right behavior. So my suggestion would be to role it back to complete with front slash for now what do you guy's think?

@dhoegh
Copy link
Contributor Author

dhoegh commented Oct 15, 2014

Base.REPLCompletions.shell_completions function was changed completing with backslash in 47d3ecf, could we role back to the old version or can we change the new to complete with front slash @lucasb-eyer?

dhoegh added a commit to dhoegh/julia that referenced this issue Oct 15, 2014
@lucasb-eyer
Copy link
Contributor

(sorry for the silence, was busy. Commenting in your PR)

dhoegh added a commit to dhoegh/julia that referenced this issue Oct 18, 2014
…ed some test cases + fixed an error that were discovered when doing `using B<tab>` before Pkg.init().
dhoegh added a commit to dhoegh/julia that referenced this issue Oct 20, 2014
…ed some test cases + fixed an error that were discovered when doing `using B<tab>` before Pkg.init().
tkelman added a commit that referenced this issue Oct 27, 2014
Fixes #8483 Windows completion error
twadleigh pushed a commit to twadleigh/julia that referenced this issue Oct 29, 2014
…ed some test cases + fixed an error that were discovered when doing `using B<tab>` before Pkg.init().
dhoegh added a commit to dhoegh/julia that referenced this issue Nov 3, 2014
…ed some test cases + fixed an error that were discovered when doing `using B<tab>` before Pkg.init().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:regression Regression in behavior compared to a previous version system:windows Affects only Windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants