From 3f3906151bfb2b6138a6950c2ea2c2f0aee03ad6 Mon Sep 17 00:00:00 2001 From: Araki Ken Date: Sun, 28 Sep 2014 15:09:09 +0900 Subject: Support GNU screen. --- terms.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'terms.c') diff --git a/terms.c b/terms.c index 50114db..1ce9e2f 100644 --- a/terms.c +++ b/terms.c @@ -595,7 +595,7 @@ put_image_sixel(char *url, int x, int y, int w, int h, int sx, int sy, int sw, i prevstop = mySignal(SIGTSTP, SIG_IGN); if ((pid = fork()) == 0) { - char *argv[11]; + char *argv[12]; char digit[2][11+1]; char clip[44+3+1]; Str str_url; @@ -610,6 +610,7 @@ put_image_sixel(char *url, int x, int y, int w, int h, int sx, int sy, int sw, i } ttymode_set(ISIG, 1); + argv[0] = "img2sixel"; argv[1] = "-l"; argv[2] = do_anim ? "auto" : "disable"; @@ -624,7 +625,13 @@ put_image_sixel(char *url, int x, int y, int w, int h, int sx, int sy, int sw, i sx*pixel_per_char_i, sy*pixel_per_line_i); argv[8] = clip; argv[9] = url; - argv[10] = NULL; + if (getenv("TERM") && strcmp(getenv("TERM"), "screen")) { + argv[10] = "-P"; + argv[11] = NULL; + } + else { + argv[10] = NULL; + } execvp(argv[0],argv); exit(0); } -- cgit v1.2.3