From 6c3b83c3b1ed5d0cb8665e2919ecafe9316c92f9 Mon Sep 17 00:00:00 2001 From: Giorgio Calderone Date: Wed, 1 Apr 2020 14:53:33 +0200 Subject: [PATCH] Print output from gnuplot process --- src/Gnuplot.jl | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Gnuplot.jl b/src/Gnuplot.jl index 22ff746..4439cc6 100644 --- a/src/Gnuplot.jl +++ b/src/Gnuplot.jl @@ -302,13 +302,16 @@ function GPSession(sid::Symbol) end if line == "GNUPLOT_CAPTURE_BEGIN" saveOutput = true + elseif line == "GNUPLOT_CAPTURE_END" + put!(channel, line) + saveOutput = false else - if ((line != "") && (line != "GNUPLOT_CAPTURE_END") && (options.verbose)) || - !isnothing(match(r"clipboard", line)) - printstyled(color=:cyan, "GNUPLOT ($sid) -> $line\n") + if line != "" + if options.verbose || !saveOutput + printstyled(color=:cyan, "GNUPLOT ($sid) -> $line\n") + end end (saveOutput) && (put!(channel, line)) - (line == "GNUPLOT_CAPTURE_END") && (saveOutput = false) end end delete!(sessions, sid)