Skip to content

Commit 7a2b963

Browse files
authored
fix REPL on 1.6 (#272)
1 parent 3213bc3 commit 7a2b963

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/repl.jl

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11

22
promptname(level, name) = "$level|$name> "
3+
4+
function write_prompt(terminal, mode)
5+
@static if VERSION v"1.6.0-DEV.517"
6+
LineEdit.write_prompt(terminal, mode, LineEdit.hascolor(terminal))
7+
else
8+
LineEdit.write_prompt(terminal, mode)
9+
end
10+
end
11+
312
function RunDebugger(frame, repl = nothing, terminal = nothing; initial_continue=false)
413
if repl === nothing
514
if !isdefined(Base, :active_repl)
@@ -109,7 +118,7 @@ function RunDebugger(frame, repl = nothing, terminal = nothing; initial_continue
109118
toggle_lowered(state)
110119
println(Base.pipe_writer(terminal))
111120
print_status(Base.pipe_writer(terminal), active_frame(state); force_lowered=state.lowered_status)
112-
LineEdit.write_prompt(state.terminal, panel)
121+
write_prompt(state.terminal, panel)
113122
else
114123
LineEdit.edit_insert(s, "L")
115124
end
@@ -119,7 +128,7 @@ function RunDebugger(frame, repl = nothing, terminal = nothing; initial_continue
119128
NUM_SOURCE_LINES_UP_DOWN[] += 1
120129
println(Base.pipe_writer(terminal))
121130
print_status(Base.pipe_writer(terminal), active_frame(state); force_lowered=state.lowered_status)
122-
LineEdit.write_prompt(state.terminal, panel)
131+
write_prompt(state.terminal, panel)
123132
else
124133
LineEdit.edit_insert(s, "+")
125134
end
@@ -129,7 +138,7 @@ function RunDebugger(frame, repl = nothing, terminal = nothing; initial_continue
129138
NUM_SOURCE_LINES_UP_DOWN[] = max(1, NUM_SOURCE_LINES_UP_DOWN[] - 1)
130139
println(Base.pipe_writer(terminal))
131140
print_status(Base.pipe_writer(terminal), active_frame(state); force_lowered=state.lowered_status)
132-
LineEdit.write_prompt(state.terminal, panel)
141+
write_prompt(state.terminal, panel)
133142
else
134143
LineEdit.edit_insert(s, "-")
135144
end

0 commit comments

Comments
 (0)