ronisbr / TerminalPager.jl

Pure Julia implementation of the command less
MIT License
116 stars 8 forks source link

long error messages in `pager>` compared to `julia>` #32

Closed haakon-e closed 11 months ago

haakon-e commented 11 months ago

If I make a simple mistake in julia>, e.g. misspell a variable name, Julia complains very briefly:

julia> myvar
ERROR: UndefVarError: `myvar` not defined

However, if I do this while in pager>, the error message is very long:

pager> myvar
ERROR: UndefVarError: `myvar` not defined
Stacktrace:
 [1] top-level scope
   @ :0
 [2] eval
   @ ./boot.jl:370 [inlined]
 [3] _tp_mode_do_cmd(repl::REPL.LineEditREPL, input::String)
   @ TerminalPager ~/.julia/packages/TerminalPager/MpAXn/src/repl.jl:243
 [4] (::TerminalPager.var"#11#14"{REPL.LineEditREPL, REPL.LineEdit.Prompt})(s::REPL.LineEdit.MIState, buf::IOBuffer, ok::Bool)
   @ TerminalPager ~/.julia/packages/TerminalPager/MpAXn/src/repl.jl:41
 [5] #invokelatest#2
   @ ./essentials.jl:819 [inlined]
 [6] invokelatest
   @ ./essentials.jl:816 [inlined]
 [7] run_interface(terminal::REPL.Terminals.TextTerminal, m::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
   @ REPL.LineEdit ~/.julia/juliaup/julia-1.9.3+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/REPL/src/LineEdit.jl:2647
 [8] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
   @ REPL ~/.julia/juliaup/julia-1.9.3+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/REPL/src/REPL.jl:1300
 [9] (::REPL.var"#62#68"{REPL.LineEditREPL, REPL.REPLBackendRef})()
   @ REPL ./task.jl:514
Details about julia ```julia (@v1.9) pkg> st Status `~/.julia/environments/v1.9/Project.toml` [6e4b80f9] BenchmarkTools v1.3.2 [89398ba2] LocalRegistry v0.5.5 [85b6ec6f] MethodAnalysis v0.4.13 [5fb14364] OhMyREPL v0.5.22 [295af30f] Revise v3.5.5 [fd094767] Suppressor v0.2.6 [0c614874] TerminalPager v0.5.0 julia> versioninfo() Julia Version 1.9.3 Commit bed2cd540a1 (2023-08-24 14:43 UTC) Build Info: Official https://julialang.org/ release Platform Info: OS: macOS (arm64-apple-darwin22.4.0) CPU: 8 × Apple M1 WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-14.0.6 (ORCJIT, apple-m1) Threads: 1 on 4 virtual cores Environment: JULIA_EDITOR = code ```
ronisbr commented 11 months ago

Thanks @haakon-e !

It should be fixed in main, can you please test before tagging a new version?

haakon-e commented 11 months ago

works like a charm, thank you!