diff --git a/src/terminal-screen.c b/src/terminal-screen.c
index a48de10..22b3e1f 100644
--- a/src/terminal-screen.c
+++ b/src/terminal-screen.c
@@ -162,7 +162,25 @@ static guint signals[LAST_SIGNAL];
 #define USERCHARS_CLASS "[" USERCHARS "]"
 #define PASSCHARS_CLASS "[-[:alnum:]\\Q,?;.:/!%$^*&~\"#'\\E]"
 #define HOSTCHARS_CLASS "[-[:alnum:]]"
-#define HOST HOSTCHARS_CLASS "+(\\." HOSTCHARS_CLASS "+)*"
+#define UNRESERVED_CLASS "[[:alnum:]-\\._~]"
+#define SUBDELIMS_CLASS "[!$&'\\(\\)\\*\\+,;=]"
+#define HOST_REGNAME HOSTCHARS_CLASS "+(\\." HOSTCHARS_CLASS "+)*"
+#define DECOCTET_CLASS "(\\d|[123456789]\\d|1\\d{2}|2[01234]\\d|25[012345])"
+#define IPV4_ADDR DECOCTET_CLASS "\\." DECOCTET_CLASS "\\." DECOCTET_CLASS "\\." DECOCTET_CLASS
+#define IPV6_H16 "[[:xdigit:]]{1,4}"
+#define IPV6_LS32 "((" IPV6_H16 ":" IPV6_H16 ")|" IPV4_ADDR ")"
+#define IPV6_ADDR                                               "(" IPV6_H16 ":){6}" IPV6_LS32 "|" \
+                                                           "::" "(" IPV6_H16 ":){5}" IPV6_LS32 "|" \
+                  "("                        IPV6_H16 ")?" "::" "(" IPV6_H16 ":){4}" IPV6_LS32 "|" \
+                  "(" "(" IPV6_H16 ":){0,1}" IPV6_H16 ")?" "::" "(" IPV6_H16 ":){3}" IPV6_LS32 "|" \
+                  "(" "(" IPV6_H16 ":){0,2}" IPV6_H16 ")?" "::" "(" IPV6_H16 ":){2}" IPV6_LS32 "|" \
+                  "(" "(" IPV6_H16 ":){0,3}" IPV6_H16 ")?" "::" "(" IPV6_H16 ":)"    IPV6_LS32 "|" \
+                  "(" "(" IPV6_H16 ":){0,4}" IPV6_H16 ")?" "::"                      IPV6_LS32 "|" \
+                  "(" "(" IPV6_H16 ":){0,5}" IPV6_H16 ")?" "::"                      IPV6_H16  "|" \
+                  "(" "(" IPV6_H16 ":){0,6}" IPV6_H16 ")?" "::"
+#define IPVFUTURE "(v[[:xdigit:]]+\\.(" UNRESERVED_CLASS "|" SUBDELIMS_CLASS "|:)+)"
+#define HOST_IPLITERAL "(\\[((" IPV6_ADDR ")|" IPVFUTURE ")\\])"
+#define HOST "((" HOST_REGNAME ")|" HOST_IPLITERAL ")"
 #define PORT "(?:\\:[[:digit:]]{1,5})?"
 #define PATHCHARS_CLASS "[-[:alnum:]\\Q_$.+!*,:;@&=?/~#%\\E]"
 #define PATHTERM_CLASS "[^\\Q]'.:}>) \t\r\n,\"\\E]"
@@ -176,6 +194,7 @@ typedef struct {
   GRegexCompileFlags flags;
 } TerminalRegexPattern;
 
+/* support IPv6 URI schemes - https://tools.ietf.org/html/rfc3986 */
 static const TerminalRegexPattern url_regex_patterns[] = {
   { SCHEME "//(?:" USERPASS "\\@)?" HOST PORT URLPATH, FLAVOR_AS_IS, G_REGEX_CASELESS },
   { "(?:www|ftp)" HOSTCHARS_CLASS "*\\." HOST PORT URLPATH , FLAVOR_DEFAULT_TO_HTTP, G_REGEX_CASELESS  },
