Skip to content

Commit 248412c

Browse files
check for compliant repl mode during repl init
1 parent 116ba91 commit 248412c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

ext/REPLExt/REPLExt.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ function create_mode(repl::REPL.AbstractREPL, main::LineEdit.Prompt)
168168
return pkg_mode
169169
end
170170

171-
function repl_init(repl::REPL.AbstractREPL)
171+
function repl_init(repl::REPL.LineEditREPL)
172172
main_mode = repl.interface.modes[1]
173173
pkg_mode = create_mode(repl, main_mode)
174174
push!(repl.interface.modes, pkg_mode)
@@ -311,7 +311,13 @@ end
311311

312312
function __init__()
313313
if isdefined(Base, :active_repl)
314-
repl_init(Base.active_repl)
314+
if Base.active_repl isa REPL.LineEditREPL
315+
repl_init(Base.active_repl)
316+
else
317+
# not sure what to do here..
318+
# LineEditREPL Is the only type of REPL that has the `interface` field that
319+
# init_repl accesses.
320+
end
315321
else
316322
atreplinit() do repl
317323
if isinteractive() && repl isa REPL.LineEditREPL

0 commit comments

Comments
 (0)