aboutsummaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorAraki Ken <arakiken@users.sf.net>2013-01-28 15:27:27 +0000
committerTatsuya Kinoshita <tats@debian.org>2014-12-06 11:47:04 +0000
commitf4268d8d18e57952b046c1bb6ab2aeeac145c310 (patch)
tree32445358c7c1ebac283d6e364ca3b18b12748a42 /main.c
parentMerge branch 'bug/parsetagx-crash' (diff)
downloadw3m-f4268d8d18e57952b046c1bb6ab2aeeac145c310.tar.gz
w3m-f4268d8d18e57952b046c1bb6ab2aeeac145c310.zip
Support remote image by OSC 5379 show_picture sequence.
Diffstat (limited to 'main.c')
-rw-r--r--main.c42
1 files changed, 41 insertions, 1 deletions
diff --git a/main.c b/main.c
index c8f1e82..e00eb5e 100644
--- a/main.c
+++ b/main.c
@@ -122,6 +122,42 @@ static int searchKeyNum(void);
#define help() fusage(stdout, 0)
#define usage() fusage(stderr, 1)
+int support_remote_image;
+
+static void
+check_support_remote_image(void)
+{
+ char *env;
+
+ if ((env = getenv("MLTERM"))) {
+ char *p;
+ int major;
+ int minor;
+ int micro;
+
+ if (!(p = strchr(env,'.')))
+ return;
+ *p = '\0';
+ major = atoi(env);
+ env = p + 1;
+
+ if (!(p = strchr(env,'.')))
+ return;
+ *p = '\0';
+ minor = atoi(env);
+ env = p + 1;
+ micro = atoi(env) ;
+
+ if (major > 3 ||
+ (major == 3 && (minor > 1 || (minor == 1 && micro >= 7)))) {
+ support_remote_image = 1 ;
+ set_environ( "W3M_USE_REMOTE_IMAGE","1"); /* for w3mimgdisplay */
+ }
+ }
+
+ return;
+}
+
static void
fversion(FILE * f)
{
@@ -409,7 +445,7 @@ main(int argc, char **argv, char **envp)
#if defined(DONT_CALL_GC_AFTER_FORK) && defined(USE_IMAGE)
char **getimage_args = NULL;
#endif /* defined(DONT_CALL_GC_AFTER_FORK) && defined(USE_IMAGE) */
-
+ check_support_remote_image();
GC_INIT();
#if defined(ENABLE_NLS) || (defined(USE_M17N) && defined(HAVE_LANGINFO_CODESET))
setlocale(LC_ALL, "");
@@ -679,6 +715,10 @@ main(int argc, char **argv, char **envp)
}
}
#endif
+ else if (!strcmp("-ri" , argv[i])) {
+ support_remote_image = 1;
+ set_environ( "W3M_USE_REMOTE_IMAGE","1"); /* for w3mimgdisplay */
+ }
else if (!strcmp("-num", argv[i]))
showLineNum = TRUE;
else if (!strcmp("-no-proxy", argv[i]))