From 62ea34f18d94cd75f36c6984cc02d51b3e4db8e8 Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Thu, 10 Oct 2024 18:20:36 -0400 Subject: [PATCH] Revert "REPL: hide any prints to stdio during `complete_line` (#55959)" This reverts commit 84a2458e0504d92b3db32bb367e449377c802593. --- stdlib/REPL/src/LineEdit.jl | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/stdlib/REPL/src/LineEdit.jl b/stdlib/REPL/src/LineEdit.jl index 3ac403df54007..c92dca8c8e015 100644 --- a/stdlib/REPL/src/LineEdit.jl +++ b/stdlib/REPL/src/LineEdit.jl @@ -366,14 +366,7 @@ end # Prompt Completions & Hints function complete_line(s::MIState) set_action!(s, :complete_line) - # suppress stderr/stdout prints during completion computation - # i.e. ambiguous qualification warnings that are printed to stderr - # TODO: remove this suppression once such warnings are better handled - # TODO: but before that change Pipe to devnull once devnull redirects work for JL_STDERR etc. - completions_exist = redirect_stdio(;stderr=Pipe(), stdout=Pipe()) do - complete_line(state(s), s.key_repeats, s.active_module) - end - if completions_exist + if complete_line(state(s), s.key_repeats, s.active_module) return refresh_line(s) else beep(s) @@ -391,13 +384,7 @@ function check_for_hint(s::MIState) end completions, partial, should_complete = try - # suppress stderr/stdout prints during completion computation - # i.e. ambiguous qualification warnings that are printed to stderr - # TODO: remove this suppression once such warnings are better handled - # TODO: but before that change Pipe to devnull once devnull redirects work for JL_STDERR etc. - completions, partial, should_complete = redirect_stdio(;stderr=Pipe(), stdout=Pipe()) do - complete_line(st.p.complete, st, s.active_module; hint = true)::Tuple{Vector{String},String,Bool} - end + complete_line(st.p.complete, st, s.active_module; hint = true)::Tuple{Vector{String},String,Bool} catch @debug "error completing line for hint" exception=current_exceptions() return clear_hint(st)