From ef99fe5e4ab142c0b98faa06f92d13240e55575b Mon Sep 17 00:00:00 2001 From: Giorgio Calderone Date: Mon, 13 Apr 2020 19:09:27 +0200 Subject: [PATCH] gnuplot repl no longer requires a global state to print returned strings --- src/Gnuplot.jl | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/Gnuplot.jl b/src/Gnuplot.jl index a88f409..cc26001 100644 --- a/src/Gnuplot.jl +++ b/src/Gnuplot.jl @@ -118,7 +118,6 @@ end # ╰───────────────────────────────────────────────────────────────────╯ const sessions = OrderedDict{Symbol, Session}() const options = Options() -const isgnuplotrepl = [false] # ╭───────────────────────────────────────────────────────────────────╮ @@ -358,9 +357,6 @@ function GPSession(sid::Symbol) saveOutput = false else if line != "" - if isgnuplotrepl[1] - println(stdout, line) - end if options.verbose || !saveOutput printstyled(color=:cyan, "GNUPLOT ($sid) -> $line\n") end @@ -1784,9 +1780,9 @@ Note: the gnuplot REPL operates only on the default session. """ function repl_init(start_key='>') function repl_exec(s) - isgnuplotrepl[1] = true - writeread(getsession(), s) - isgnuplotrepl[1] = false + for s in writeread(getsession(), s) + println(s) + end nothing end