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

got error on the Base.run_main_repl when have_color is nothing #36298

Closed
wookay opened this issue Jun 15, 2020 · 6 comments
Closed

got error on the Base.run_main_repl when have_color is nothing #36298

wookay opened this issue Jun 15, 2020 · 6 comments

Comments

@wookay
Copy link
Contributor

wookay commented Jun 15, 2020

hello. when I trying this

$ julia --color=auto -e "Base.run_main_repl(true, true, false, true, false)"
julia>
$ julia --color=auto -e "Base.run_main_repl(true, true, false, true, true)"
ERROR: MethodError: no method matching REPL.LineEditREPL(::REPL.Terminals.TTYTerminal, ::Nothing, ::Bool)
Closest candidates are:
  REPL.LineEditREPL(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any) at /Users/wookyoung/head/julia/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:450
  REPL.LineEditREPL(::REPL.Terminals.TextTerminal, ::Bool, ::Bool) at /Users/wookyoung/head/julia/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:460
  REPL.LineEditREPL(::REPL.Terminals.TextTerminal, ::Bool) at /Users/wookyoung/head/julia/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:460
Stacktrace:
 [1] (::Base.var"#833#835"{Bool,Bool,Bool,Bool})(::Module) at ./client.jl:380
 [2] #invokelatest#1 at ./essentials.jl:710 [inlined]
 [3] invokelatest at ./essentials.jl:709 [inlined]
 [4] run_main_repl(::Bool, ::Bool, ::Bool, ::Bool, ::Bool) at ./client.jl:371
 [5] top-level scope at none:1

This is probably a missed bug that since the PR : Enable color output whenever stdout is TTY #34347 has introduced the global variable have_color as being [nothing].(https://github.com/JuliaLang/julia/pull/34347/files#diff-8d2b8a22d475d81e3a1944aedb57ad42R6)

At the function run_main_repl in base/client.jl

function run_main_repl(interactive::Bool, quiet::Bool, banner::Bool, history_file::Bool, color_set::Bool)
# ...
                active_repl = REPL.LineEditREPL(term, have_color, true)

I think that the above line should be changed to something like:

                 active_repl = REPL.LineEditREPL(term, have_color === true, true)
julia> versioninfo()
Julia Version 1.6.0-DEV.229
Commit a66ee3f28a* (2020-06-15 19:40 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin19.5.0)
  CPU: Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-9.0.1 (ORCJIT, skylake)
Environment:
  JULIA_CUDA_SILENT = 1

thanks.

@mgautam98
Copy link
Contributor

I am not able to reproduce it. It works fine for me on Windows and Linux.

@wookay
Copy link
Contributor Author

wookay commented Jun 16, 2020

I have made reproducing it on github actions.
https://github.com/wookay/Test36298.jl/runs/777905874?check_suite_focus=true#step:4:13

@mgautam98
Copy link
Contributor

Thanks I was able to reproduce it and I fix it. Should I send a PR for this?

@wookay
Copy link
Contributor Author

wookay commented Jun 16, 2020

@mgautam98 Sure, you could.

@JeffBezanson
Copy link
Member

What is the use case for calling run_main_repl? It's an internal function. The last argument, color_set, means that a color setting has been specified, so passing true when that isn't the case is inconsistent, so I'm not sure there's anything to do here.

@wookay
Copy link
Contributor Author

wookay commented Jun 18, 2020

oh, if so, it's not a bug.
closing the issue.

@wookay wookay closed this as completed Jun 18, 2020
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

3 participants