Skip to content

Commit

Permalink
Store the frontend task object in the REPL struct. (#48400)
Browse files Browse the repository at this point in the history
  • Loading branch information
maleadt authored Jan 27, 2023
1 parent bd8ffef commit 87f8958
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions stdlib/REPL/src/REPL.jl
Original file line number Diff line number Diff line change
Expand Up @@ -389,13 +389,15 @@ end
mutable struct BasicREPL <: AbstractREPL
terminal::TextTerminal
waserror::Bool
frontend_task::Task
BasicREPL(t) = new(t, false)
end

outstream(r::BasicREPL) = r.terminal
hascolor(r::BasicREPL) = hascolor(r.terminal)

function run_frontend(repl::BasicREPL, backend::REPLBackendRef)
repl.frontend_task = current_task()
d = REPLDisplay(repl)
dopushdisplay = !in(d,Base.Multimedia.displays)
dopushdisplay && pushdisplay(d)
Expand Down Expand Up @@ -462,6 +464,7 @@ mutable struct LineEditREPL <: AbstractREPL
last_shown_line_infos::Vector{Tuple{String,Int}}
interface::ModalInterface
backendref::REPLBackendRef
frontend_task::Task
function LineEditREPL(t,hascolor,prompt_color,input_color,answer_color,shell_color,help_color,history_file,in_shell,in_help,envcolors)
opts = Options()
opts.hascolor = hascolor
Expand Down Expand Up @@ -1281,6 +1284,7 @@ function setup_interface(
end

function run_frontend(repl::LineEditREPL, backend::REPLBackendRef)
repl.frontend_task = current_task()
d = REPLDisplay(repl)
dopushdisplay = repl.specialdisplay === nothing && !in(d,Base.Multimedia.displays)
dopushdisplay && pushdisplay(d)
Expand All @@ -1306,6 +1310,7 @@ mutable struct StreamREPL <: AbstractREPL
input_color::String
answer_color::String
waserror::Bool
frontend_task::Task
StreamREPL(stream,pc,ic,ac) = new(stream,pc,ic,ac,false)
end
StreamREPL(stream::IO) = StreamREPL(stream, Base.text_colors[:green], Base.input_color(), Base.answer_color())
Expand Down Expand Up @@ -1364,6 +1369,7 @@ ends_with_semicolon(code::Union{String,SubString{String}}) =
contains(_rm_strings_and_comments(code), r";\s*$")

function run_frontend(repl::StreamREPL, backend::REPLBackendRef)
repl.frontend_task = current_task()
have_color = hascolor(repl)
Base.banner(repl.stream)
d = REPLDisplay(repl)
Expand Down

2 comments on commit 87f8958

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily package evaluation, I will reply here when finished:

@nanosoldier runtests(isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your package evaluation job has completed - possible new issues were detected.
A full report can be found here.

Please sign in to comment.