From 05f02f366241b730d8bca3846842bb9ab8cc3543 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Sun, 24 Nov 2019 12:40:28 +0100 Subject: [PATCH] On Linux: allow calling gnuplot without invoking a terminal. Reported by Terry Pilling --- src/frontend/plotting/gnuplot.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/frontend/plotting/gnuplot.c b/src/frontend/plotting/gnuplot.c index 2d5220d03..57811e243 100644 --- a/src/frontend/plotting/gnuplot.c +++ b/src/frontend/plotting/gnuplot.c @@ -94,6 +94,8 @@ ft_gnuplot(double *xlims, double *ylims, char *filename, char *title, char *xlab terminal_type = 4; if (cieq(terminal, "eps/quit")) terminal_type = 5; + if (cieq(terminal, "xterm")) + terminal_type = 6; } if (!cp_getvar("xbrushwidth", CP_NUM, &linewidth, 0)) @@ -342,8 +344,10 @@ ft_gnuplot(double *xlims, double *ylims, char *filename, char *title, char *xlab fprintf(cp_out, "writing plot to file %s.eps\n", filename); (void) sprintf(buf, "gnuplot %s", filename_plt); } - else + else if (terminal_type == 6) (void) sprintf(buf, "xterm -e gnuplot %s - &", filename_plt); + else + (void) sprintf(buf, "gnuplot -p %s - &", filename_plt); #endif err = system(buf);