From bc963be3ef8ed7b1dbb6166549cee1b294f6177e Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Wed, 30 Oct 2024 12:00:01 -0400 Subject: [PATCH 1/2] check for compliant repl mode during repl init --- 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..b494b9872e 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 + # 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 From 72cc3f501d4b4ea7a0b13e31ab667d5fb4e04b78 Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Sun, 3 Nov 2024 20:43:38 -0500 Subject: [PATCH 2/2] Update ext/REPLExt/REPLExt.jl --- ext/REPLExt/REPLExt.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/REPLExt/REPLExt.jl b/ext/REPLExt/REPLExt.jl index b494b9872e..92e636cd2f 100644 --- a/ext/REPLExt/REPLExt.jl +++ b/ext/REPLExt/REPLExt.jl @@ -314,7 +314,7 @@ function __init__() if Base.active_repl isa REPL.LineEditREPL repl_init(Base.active_repl) else - # not sure what to do here.. + # TODO: not sure what to do here.. # LineEditREPL Is the only type of REPL that has the `interface` field that # init_repl accesses. end