Control: tag -1 + patch On Mon, Mar 30, 2020 at 05:45:33PM -0300, Antonio Terceiro wrote: > Package: terminator > Version: 1.91-4 > Severity: normal > > I just installed terminator. All the documentation I found, and the > preferences dialog, led me to expect URLs to be clickable. However, they > are not. They work just find on gnome-terminal in the same machine, so > maybe there is something wrong with how terminator talks to vte for it.
Looking up the vte documentation online, it suggests that add_match_gregex was deprecated some time ago, and made a noop at some point. The attached patch seems to fix it for me. I will be running it for the text days and will let you know if I find any issue with it.
--- a/terminatorlib/terminal.py
+++ b/terminatorlib/terminal.py
@@ -143,8 +143,7 @@ class Terminal(Gtk.VBox):
self.vte.show()
self.default_encoding = self.vte.get_encoding()
- self.regex_flags = (GLib.RegexCompileFlags.OPTIMIZE | \
- GLib.RegexCompileFlags.MULTILINE)
+ self.regex_flags = Vte.REGEX_FLAGS_DEFAULT
self.update_url_matches()
self.terminalbox = self.create_terminalbox()
@@ -271,8 +270,8 @@ class Terminal(Gtk.VBox):
re = (lboundry + schemes +
"//(" + user + "@)?[" + hostchars +".]+(:[0-9]+)?(" +
urlpath + ")?" + rboundry + "/?")
- reg = GLib.Regex.new(re, self.regex_flags, 0)
- self.matches['full_uri'] = self.vte.match_add_gregex(reg, 0)
+ reg = Vte.Regex.new_for_match(re, len(re), self.regex_flags)
+ self.matches['full_uri'] = self.vte.match_add_regex(reg, 0)
if self.matches['full_uri'] == -1:
err ('Terminal::update_url_matches: Failed adding URL matches')
@@ -281,24 +280,24 @@ class Terminal(Gtk.VBox):
'(callto:|h323:|sip:)' + "[" + userchars + "+][" +
userchars + ".]*(:[0-9]+)?@?[" + pathchars + "]+" +
rboundry)
- reg = GLib.Regex.new(re, self.regex_flags, 0)
- self.matches['voip'] = self.vte.match_add_gregex(reg, 0)
+ reg = Vte.Regex.new_for_match(re, len(re), self.regex_flags)
+ self.matches['voip'] = self.vte.match_add_regex(reg, 0)
re = (lboundry +
"(www|ftp)[" + hostchars + "]*\.[" + hostchars +
".]+(:[0-9]+)?(" + urlpath + ")?" + rboundry + "/?")
- reg = GLib.Regex.new(re, self.regex_flags, 0)
- self.matches['addr_only'] = self.vte.match_add_gregex(reg, 0)
+ reg = Vte.Regex.new_for_match(re, len(re), self.regex_flags)
+ self.matches['addr_only'] = self.vte.match_add_regex(reg, 0)
re = (lboundry +
"(mailto:)?[a-zA-Z0-9][a-zA-Z0-9.+-]*@[a-zA-Z0-9]" +
"[a-zA-Z0-9-]*\.[a-zA-Z0-9][a-zA-Z0-9-]+" +
"[.a-zA-Z0-9-]*" + rboundry)
- reg = GLib.Regex.new(re, self.regex_flags, 0)
- self.matches['email'] = self.vte.match_add_gregex(reg, 0)
+ reg = Vte.Regex.new_for_match(re, len(re), self.regex_flags)
+ self.matches['email'] = self.vte.match_add_regex(reg, 0)
re = (lboundry +
"""news:[-A-Z\^_a-z{|}~!"#$%&'()*+,./0-9;:=?`]+@""" +
"[-A-Za-z0-9.]+(:[0-9]+)?" + rboundry)
- reg = GLib.Regex.new(re, self.regex_flags, 0)
- self.matches['nntp'] = self.vte.match_add_gregex(reg, 0)
+ reg = Vte.Regex.new_for_match(re, len(re), self.regex_flags)
+ self.matches['nntp'] = self.vte.match_add_regex(reg, 0)
# Now add any matches from plugins
try:
@@ -312,8 +311,8 @@ class Terminal(Gtk.VBox):
if name in self.matches:
dbg('refusing to add duplicate match %s' % name)
continue
- reg = GLib.Regex.new(match, self.regex_flags, 0)
- self.matches[name] = self.vte.match_add_gregex(reg, 0)
+ reg = Vte.Regex.new_for_match(match, len(match), self.regex_flags)
+ self.matches[name] = self.vte.match_add_regex(reg, 0)
dbg('added plugin URL handler for %s (%s) as %d' %
(name, urlplugin.__class__.__name__,
self.matches[name]))
@@ -325,8 +324,8 @@ class Terminal(Gtk.VBox):
if name in self.matches:
err('Terminal::match_add: Refusing to create duplicate match %s' % name)
return
- reg = GLib.Regex.new(match, self.regex_flags, 0)
- self.matches[name] = self.vte.match_add_gregex(reg, 0)
+ reg = Vte.Regex.new_for_match(match, len(match), self.regex_flags)
+ self.matches[name] = self.vte.match_add_regex(reg, 0)
def match_remove(self, name):
"""Remove a previously registered URL match"""
signature.asc
Description: PGP signature

