@@ -2740,10 +2740,12 @@ end
2740
2740
2741
2741
function run_interface (terminal:: TextTerminal , m:: ModalInterface , s:: MIState = init_state (terminal, m))
2742
2742
while ! s. aborted
2743
- buf, ok, suspend = prompt! (terminal, m, s)
2743
+ # spawn this so because the main repl task is sticky (due to use of @async and _wait2)
2744
+ # and we want to not block typing when the repl task thread is busy
2745
+ buf, ok, suspend = fetch (Threads. @spawn :interactive prompt! (terminal, m, s))
2744
2746
while suspend
2745
2747
@static if Sys. isunix (); ccall (:jl_repl_raise_sigtstp , Cint, ()); end
2746
- buf, ok, suspend = prompt! (terminal, m, s)
2748
+ buf, ok, suspend = fetch (Threads . @spawn :interactive prompt! (terminal, m, s) )
2747
2749
end
2748
2750
Base. invokelatest (mode (state (s)). on_done, s, buf, ok)
2749
2751
end
@@ -2829,7 +2831,7 @@ function prompt!(term::TextTerminal, prompt::ModalInterface, s::MIState = init_s
2829
2831
activate (prompt, s, term, term)
2830
2832
old_state = mode (s)
2831
2833
l = Base. ReentrantLock ()
2832
- t = @async while true
2834
+ t = Threads . @spawn :interactive while true
2833
2835
wait (s. async_channel)
2834
2836
status = @lock l begin
2835
2837
fcn = take! (s. async_channel)
0 commit comments