diff --git a/src/session/download.c b/src/session/download.c index fa968a762..69db67369 100644 --- a/src/session/download.c +++ b/src/session/download.c @@ -985,6 +985,25 @@ tp_open(struct type_query *type_query) return; } + if (type_query->uri->protocol == PROTOCOL_FILE) { + unsigned char *file = get_uri_string(type_query->uri, URI_PATH); + unsigned char *handler = NULL; + + if (file) { + handler = subst_file(type_query->external_handler, file); + mem_free(file); + } + + if (handler) { + exec_on_terminal(type_query->ses->tab->term, + handler, "", !!type_query->block); + mem_free(handler); + } + + done_type_query(type_query); + return; + } + continue_download(type_query, ""); }