IJulia.jl
IJulia.jl copied to clipboard
Terminal menus doesent work
hello.
I have Julia installed on a server with multiple users. so I have a global repository in which the most used packages are installed for all the users and a local depository in which users can install their own packages.
when using Julia in the terminal and for example if a user wants to add the Example
package, the Julia asks to add from which repository.
like the image below.
But when trying to add packages from the Jupyter notebook (no matter the classic jupyter or jupyterlab) it throws the following error.
┌ Warning: TerminalMenus: Unable to enter raw mode: ArgumentError("stream is closed or unusable")
└ @ REPL.TerminalMenus /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/REPL/src/TerminalMenus/util.jl:21
BoundsError: attempt to access 0-element Array{UInt8,1} at index [1]
Stacktrace:
[1] getindex at ./array.jl:731 [inlined]
[2] readNextChar(::Base.PipeEndpoint) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/REPL/src/TerminalMenus/util.jl:39
[3] _readKey(::Base.PipeEndpoint) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/REPL/src/TerminalMenus/util.jl:46
[4] readKey(::Base.PipeEndpoint) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/REPL/src/TerminalMenus/util.jl:44
[5] request(::REPL.Terminals.TTYTerminal, ::REPL.TerminalMenus.RadioMenu) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/REPL/src/TerminalMenus/AbstractMenu.jl:135
[6] request(::REPL.Terminals.TTYTerminal, ::String, ::REPL.TerminalMenus.RadioMenu) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/REPL/src/TerminalMenus/AbstractMenu.jl:220
[7] request(::String, ::REPL.TerminalMenus.RadioMenu) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/REPL/src/TerminalMenus/AbstractMenu.jl:216
[8] registered_uuid(::Pkg.Types.EnvCache, ::String) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/Types.jl:1064
[9] registry_resolve!(::Pkg.Types.EnvCache, ::Array{Pkg.Types.PackageSpec,1}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/Types.jl:841
[10] #add_or_develop#13(::Symbol, ::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:57
[11] #add_or_develop at ./none:0 [inlined]
[12] #add_or_develop#12 at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:29 [inlined]
[13] #add_or_develop at ./none:0 [inlined]
[14] #add_or_develop#11 at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:28 [inlined]
[15] #add_or_develop at ./none:0 [inlined]
[16] #add_or_develop#10 at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:27 [inlined]
[17] #add_or_develop at ./none:0 [inlined]
[18] #add#18 at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:69 [inlined]
[19] add(::String) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:69
[20] top-level scope at In[9]:1
I now that in the julia package manager they used TerminalMenus.jl package. I test that if this package can interact with jupyter or not and it comes that it can`t interact with Jupiter notebook to. I didn't know that's an IJulia problem or Jupyter notebook. so I thought to mention this here first.
thank you.
TerminalMenus.jl currently relies on having a real tty-like terminal, which is not supported in Jupyter notebooks.
To make this work in IJulia, you would first need to abstract the TerminalMenus package so that it could use non-tty backends, and then implement some kind of widget in Jupyter for this … even then, since the Jupyter protocol does not support menu widgets, it would be impossible to get something that worked with arbitrary Jupyter front-ends.