From 62ebf0cf30504726b2ebb9f081ee40e42f4966af Mon Sep 17 00:00:00 2001 From: Stephen Boddy Date: Wed, 2 Dec 2015 22:48:33 +0100 Subject: [PATCH 1/2] Fix middle-click insert primary selection for Wayland (N/A) to insert from clipboard instead --- terminatorlib/terminal.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/terminatorlib/terminal.py b/terminatorlib/terminal.py index e4ae8d4b..ec27a1e5 100755 --- a/terminatorlib/terminal.py +++ b/terminatorlib/terminal.py @@ -13,7 +13,7 @@ from gi.repository import Vte import subprocess import urllib -from util import dbg, err, spawn_new_terminator, make_uuid, manual_lookup +from util import dbg, err, spawn_new_terminator, make_uuid, manual_lookup, display_manager import util from config import Config from cwd import get_default_cwd @@ -924,11 +924,12 @@ class Terminal(Gtk.VBox): # Suppress double-click behavior return True + use_primary = (display_manager() != 'WAYLAND') if self.config['putty_paste_style']: middle_click = [self.popup_menu, (widget, event)] - right_click = [self.paste_clipboard, (True, )] + right_click = [self.paste_clipboard, (use_primary, )] else: - middle_click = [self.paste_clipboard, (True, )] + middle_click = [self.paste_clipboard, (use_primary, )] right_click = [self.popup_menu, (widget, event)] if event.button == self.MOUSEBUTTON_LEFT: From 3e44db0b95c41c017cbb6046087c7dcde6fb42dd Mon Sep 17 00:00:00 2001 From: Stephen Boddy Date: Wed, 2 Dec 2015 22:48:54 +0100 Subject: [PATCH 2/2] Remove invalid double-quote (") from the pathchar for url regex matching --- terminatorlib/terminal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terminatorlib/terminal.py b/terminatorlib/terminal.py index ec27a1e5..76037d94 100755 --- a/terminatorlib/terminal.py +++ b/terminatorlib/terminal.py @@ -262,7 +262,7 @@ class Terminal(Gtk.VBox): userchars = "-A-Za-z0-9" passchars = "-A-Za-z0-9,?;.:/!%$^*&~\"#'" hostchars = "-A-Za-z0-9" - pathchars = "-A-Za-z0-9_$.+!*(),;:@&=?/~#%'\"" + pathchars = "-A-Za-z0-9_$.+!*(),;:@&=?/~#%'" schemes = "(news:|telnet:|nntp:|file:/|https?:|ftps?:|webcal:)" user = "[" + userchars + "]+(:[" + passchars + "]+)?" urlpath = "/[" + pathchars + "]*[^]'.}>) \t\r\n,\\\"]"