We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 47669d1 commit 01d0c61Copy full SHA for 01d0c61
src/workflows.jl
@@ -231,11 +231,18 @@ function optimize_or_load(
231
verbose,
232
_else=_print_loaded_output
233
) do
234
+ color = get(stdout, :color, false)
235
+ if haskey(ENV, "JULIA_CAPTURE_COLOR")
236
+ # Undocumented feature. Literate.jl doesn't work well with captured
237
+ # color. When doing an optimization in a Literate example, it's
238
+ # best to evaluate it with JULIA_CAPTURE_COLOR=0
239
+ color = (ENV["JULIA_CAPTURE_COLOR"] != "0")
240
+ end
241
if isnothing(logfile)
242
c = IOCapture.capture(
243
passthrough=true,
244
capture_buffer=FirstLastBuffer(),
- color=get(stdout, :color, false)
245
+ color=color,
246
247
optimize(problem; method, verbose, atexit_filename, kwargs...)
248
end
0 commit comments