Skip to content

Commit 4dda14f

Browse files
fix: suppress 'press q' prompt when input_stream is devnull
When input_stream=devnull, the user cannot interactively quit via stdin, so the prompt is misleading. The stdin monitoring is already effectively disabled because isreadable(devnull) is false, but the prompt was still printed. Co-authored-by: Miles Cranmer <miles.cranmer@gmail.com>
1 parent 503f935 commit 4dda14f

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/SearchUtils.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,9 @@ function update_progress_bar!(
491491
@sprintf("Full dataset evaluations per second: [.....]. ")
492492
end
493493
load_string *= get_load_string(; head_node_occupation, parallelism)
494-
load_string *= @sprintf("Press 'q' and then <enter> to stop execution early.")
494+
if options.input_stream != devnull
495+
load_string *= @sprintf("Press 'q' and then <enter> to stop execution early.")
496+
end
495497
equation_strings = string_dominating_pareto_curve(
496498
hall_of_fame, dataset, options; width=barlen(progress_bar)
497499
)
@@ -541,7 +543,10 @@ function print_search_state(
541543
print(equation_strings * "\n")
542544
print(""^twidth * "\n")
543545
end
544-
return print("Press 'q' and then <enter> to stop execution early.\n")
546+
if options.input_stream != devnull
547+
print("Press 'q' and then <enter> to stop execution early.\n")
548+
end
549+
return nothing
545550
end
546551

547552
function load_saved_hall_of_fame(saved_state)

0 commit comments

Comments
 (0)