aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAraki Ken <arakiken@users.sf.net>2014-09-28 06:09:09 +0000
committerTatsuya Kinoshita <tats@debian.org>2014-12-06 11:47:05 +0000
commit3f3906151bfb2b6138a6950c2ea2c2f0aee03ad6 (patch)
treee9ff96a6be26ff4d9624313168f5687d59c5bc0c
parentShow GIF (except animation GIF) correctly. (diff)
downloadw3m-3f3906151bfb2b6138a6950c2ea2c2f0aee03ad6.tar.gz
w3m-3f3906151bfb2b6138a6950c2ea2c2f0aee03ad6.zip
Support GNU screen.
Diffstat (limited to '')
-rw-r--r--terms.c11
1 files changed, 9 insertions, 2 deletions
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);
}