Interactive error messages for the Julia REPL.
julia> using Pkg julia> Pkg.add("InteractiveErrors")
using InteractiveErrors to your
startup.jl file after
If you don't have that installed yet you should install it.
Just start using your REPL normally. Once you hit an error you'll be presented
with an interactive tree representing your stacktrace which you can explore. To
turn interactive errors off and return to using normal stacktraces call
toggle() again to turn it back on.
down arrows to move through the stacktrace. Press
fold or unfold the currently selected line. A
+ will appear on folded lines.
enter once finished. If you are on a line that references a particular
file then that will present additional options in the next menu.
q can be
pressed to exit back to the REPL.
Note: a lot of information is hidden inside some of the folded lines and some is completely stripped from the display (such as method arguments). The default choice of information to display is up for discussion. Unfolding a line containing a file and line number will display the immediate lines surrounding it.
The second menu offers several actions that can be taken on the selected line.
[press: d=done, a=all, n=none] • [ ] ascend [ ] descend [ ] JET [ ] edit [ ] retry [ ] breakpoint [ ] less [ ] clipboard [ ] print [ ] stacktrace [ ] exception [ ] backtrace
enter to choose the currently selected line. More than one can be chosen:
Cthulhuis loaded) calls
Cthulhu.ascendon the selected method.
Cthulhuis loaded) calls
Cthulhu.descendon the selected method.
JETis loaded) calls
JET.report_callon the selected method.
editopens default editor on the selected file and line.
retryruns the code entered in the REPL again.
Debuggeris loaded) sets a
Debugger.breakpointon the selected file and line.
lessopens the pager on the selected file and line.
clipboardcopies the normal Julia stacktrace to the clipboard. Useful for posting bug reports. Don't send the interactive printout as an error message when reporting issues to packages or Julia.
stacktracereturns the stacktrace object.
exceptionreturns the exception object that was caught.
backtracereturns the raw backtrace object. Contains
Ptrs. Not terribly useful.
More than one action can be selected at once. A common combination is
d (for done) once you're finished making your choices.
Additional features are available when certain packages are loaded within the REPL session.
descendoptions on selected method.
breakpointon selected method.
report_callon selected method.
JuliaFormatter, provides syntax formatting for method signatures.
OhMyREPL, provides syntax highlighting for source code and method signatures.
Depending on the maintenance burden of compatibility with these packages they
may in future versions become direct dependencies instead of using
Most of the default coloring in the stack-tree can be adjusted to the user's liking via a simple theming system.
current_theme()returns the currently active theme: a nested
NamedTupleof customisation options.
set_theme!can be used to set your own custom theme that follows the same naming scheme as the default theme. Takes either keyword arguments, or a
reset_theme!will reset the theme.
adjust_theme!can be used if you only want to make some minor adjustments to the
current_theme. Takes a
NamedTupleor keyword arguments that will be
merged with the
The default theme is shown below:
pairs(::NamedTuple) with 19 entries: :function_name => (bold = true,) :directory => (color = :light_black,) :filename => (color = :magenta, bold = true) :line_number => (color = :green, bold = true) :user_stack => (color = :green, bold = true) :system_stack => (color = :red, bold = true) :stdlib_module => (color = :yellow,) :base_module => (color = :blue,) :core_module => (color = :light_black,) :package_module => (color = :cyan, bold = true) :unknown_module => (color = :red,) :inlined_frames => (color = :light_black,) :toplevel_frames => (color = :light_black,) :repeated_frames => (color = :red,) :file_contents => (color = :light_black,) :signature => (color = :light_black, format = true, highlight = true) :source => (color = :normal, bold = true, highlight = true) :line_range => (before = 0, after = 5) :charset => :unicode