From ecd3cb6b63a650a5d9609f2f6ac1f7ab150096b6 Mon Sep 17 00:00:00 2001 From: Stephen Boddy Date: Sun, 29 Nov 2015 03:07:13 +0100 Subject: [PATCH] Fix copy on selection to work on already open terminals --- terminatorlib/terminal.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/terminatorlib/terminal.py b/terminatorlib/terminal.py index 3251d04a..4ea73db7 100755 --- a/terminatorlib/terminal.py +++ b/terminatorlib/terminal.py @@ -352,6 +352,10 @@ class Terminal(Gtk.VBox): self.vte.match_remove(self.matches[name]) del(self.matches[name]) + def maybe_copy_clipboard(self): + if self.config['copy_on_selection']: + self.vte.copy_clipboard() + def connect_signals(self): """Connect all the gtk signals and drag-n-drop mechanics""" @@ -410,10 +414,8 @@ class Terminal(Gtk.VBox): self.vte.connect('drag-data-received', self.on_drag_data_received, self) - # FIXME: Shouldn't this be in configure()? - if self.config['copy_on_selection']: - self.cnxids.new(self.vte, 'selection-changed', - lambda widget: self.vte.copy_clipboard()) + self.cnxids.new(self.vte, 'selection-changed', + lambda widget: self.maybe_copy_clipboard()) if self.composite_support: self.vte.connect('composited-changed', self.reconfigure)