From fd8ad1bbea7f637acc8ab9595b79db01bc9349c6 Mon Sep 17 00:00:00 2001 From: Iain Lane Date: Mon, 8 Sep 2008 20:21:26 +0100 Subject: [PATCH] Launch ftp.x.y with an ftp protocol --- terminatorlib/terminatorterm.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/terminatorlib/terminatorterm.py b/terminatorlib/terminatorterm.py index b69dac1c..0091ec76 100755 --- a/terminatorlib/terminatorterm.py +++ b/terminatorlib/terminatorterm.py @@ -832,8 +832,14 @@ text/plain if url: if url[1] != self.matches['email']: - if url[1]: # Assume HTTP if we launch a URL with no protocol, otherwise xdg-open won't open it - address = "http://" + url[0] + # Add protocol if we launch a URL without it, otherwise xdg-open won't open it + if url[1] == self.matches['addr_only']: + if url[0][0:3] == "ftp": + # "ftp.foo.bar" -> "ftp://ftp.foo.bar" + address = "ftp://" + url[0] + else: + # Assume http + address = "http://" + url[0] else: address = url[0] nameopen = _("_Open Link")