From e10883ce583eca9c2b81c85d4b7be76e1fcecf1b Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Mon, 4 Nov 2024 09:26:21 -0500 Subject: [PATCH] REPLExt: check for compliant repl mode during repl init (#4067) * check for compliant repl mode during repl init * Update ext/REPLExt/REPLExt.jl --- ext/REPLExt/REPLExt.jl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ext/REPLExt/REPLExt.jl b/ext/REPLExt/REPLExt.jl index 3e3065a585..92e636cd2f 100644 --- a/ext/REPLExt/REPLExt.jl +++ b/ext/REPLExt/REPLExt.jl @@ -168,7 +168,7 @@ function create_mode(repl::REPL.AbstractREPL, main::LineEdit.Prompt) return pkg_mode end -function repl_init(repl::REPL.AbstractREPL) +function repl_init(repl::REPL.LineEditREPL) main_mode = repl.interface.modes[1] pkg_mode = create_mode(repl, main_mode) push!(repl.interface.modes, pkg_mode) @@ -311,7 +311,13 @@ end function __init__() if isdefined(Base, :active_repl) - repl_init(Base.active_repl) + if Base.active_repl isa REPL.LineEditREPL + repl_init(Base.active_repl) + else + # TODO: not sure what to do here.. + # LineEditREPL Is the only type of REPL that has the `interface` field that + # init_repl accesses. + end else atreplinit() do repl if isinteractive() && repl isa REPL.LineEditREPL