Skip to content

Commit 71068e4

Browse files
committed
bind STDIN to /dev/tty to work gnuplot prompt even if tbplot is used after pipe.
1 parent efe088b commit 71068e4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

sample/tbplot

+5
Original file line numberDiff line numberDiff line change
@@ -428,9 +428,14 @@ def output_gnuplot(checkers, tmps, table_filename, image_filename)
428428
tmp_gnuplot_command.close
429429
#puts gnuplot_command; sleep 100
430430
args = ['gnuplot', tmp_gnuplot_command.path]
431+
opt = {}
431432
if $gnuplot_prompt
432433
args << '-' # enter interactive mode.
434+
if !STDIN.tty?
435+
opt[:in] = '/dev/tty'
436+
end
433437
end
438+
args << opt if !opt.empty?
434439
system(*args)
435440
end
436441

0 commit comments

Comments
 (0)