diff --git a/ChangeLog b/ChangeLog index 4d9e1cdb..4ab847fb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,12 +13,16 @@ terminator trunk: * remotinator now uses argparse for commandline option handling, vastly improving the option handling * remotinator help strings are translatable now + * PuTTY paste mode (Nemilya, LP#1416682) with some alterations + (Steve Boddy) * Bug fixes * Fix for those not running IBus, where the IBus workaround caused broken keys in other keymaps set with non-IBus tools (Steve Boddy, LP#1494606) * Fix custom commands to use the standard gerr function instead of the broken local one (Steve Boddy) + * Workaround for intltool not handling Python files without an + extension (Steve Boddy) terminator 0.98: * Features diff --git a/doc/manual/source/preferences.rst b/doc/manual/source/preferences.rst index 720c3c72..58fec3d0 100644 --- a/doc/manual/source/preferences.rst +++ b/doc/manual/source/preferences.rst @@ -93,6 +93,12 @@ Behaviour receive keystrokes. - *None* - Only the current terminal receives keystrokes. + **PuTTY style paste** (default: off) + + Make the right mouse button operate like in PuTTY, so ``right-click`` + will paste the Primary selection, and ``middle-click`` will open + the :ref:`Context Menu `. (For ex-PuTTY users). + **Re-use profiles for new terminals** (default: off) When creating a new terminal with splitting or new tabs, if this is diff --git a/doc/terminator_config.5 b/doc/terminator_config.5 index 0fa344f9..f7c2d361 100644 --- a/doc/terminator_config.5 +++ b/doc/terminator_config.5 @@ -136,6 +136,10 @@ Controls whether splits/tabs will continue to use the profile of their peer term the default profile. Default value: \fBFalse\fR .TP +.B putty_paste_style \fR(boolean) +If set to True, right-click will paste the Primary selection, middle-click will popup the context menu. +Default value: \fBFalse\fR +.TP .B enabled_plugins A list of plugins which should be loaded by default. All other plugin classes will be ignored. The default value includes two plugins related to Launchpad, which are enabled by default to provide continuity with earlier releases where these were the diff --git a/terminatorlib/config.py b/terminatorlib/config.py index 5e2a8845..82f8b7be 100755 --- a/terminatorlib/config.py +++ b/terminatorlib/config.py @@ -121,6 +121,7 @@ DEFAULTS = { 'always_split_with_profile': False, 'title_use_system_font' : True, 'title_font' : 'Sans 9', + 'putty_paste_style' : False, }, 'keybindings': { 'zoom_in' : 'plus', diff --git a/terminatorlib/preferences.glade b/terminatorlib/preferences.glade index ed484a1c..42ca9935 100644 --- a/terminatorlib/preferences.glade +++ b/terminatorlib/preferences.glade @@ -547,7 +547,7 @@ True False - 6 + 7 2 12 6 @@ -620,6 +620,22 @@ + + + Putty style paste + True + True + False + False + True + + + + 2 + 2 + 3 + + Re-use profiles for new terminals @@ -633,8 +649,8 @@ 2 - 2 - 3 + 3 + 4 GTK_FILL @@ -651,8 +667,8 @@ 2 - 3 - 4 + 4 + 5 GTK_FILL @@ -703,8 +719,8 @@ 2 - 4 - 5 + 5 + 6 GTK_FILL @@ -722,8 +738,8 @@ 2 - 5 - 6 + 6 + 7 GTK_FILL diff --git a/terminatorlib/prefseditor.py b/terminatorlib/prefseditor.py index 21bf79fb..c67033e2 100755 --- a/terminatorlib/prefseditor.py +++ b/terminatorlib/prefseditor.py @@ -425,6 +425,9 @@ class PrefsEditor: # Copy on selection widget = guiget('copy_on_selection') widget.set_active(self.config['copy_on_selection']) + # Putty paste style + widget = guiget('putty_paste_style') + widget.set_active(self.config['putty_paste_style']) # Word chars widget = guiget('word_chars_entry') widget.set_text(self.config['word_chars']) @@ -722,6 +725,11 @@ class PrefsEditor: self.config['copy_on_selection'] = widget.get_active() self.config.save() + def on_putty_paste_style_toggled(self, widget): + """Putty paste style setting changed""" + self.config['putty_paste_style'] = widget.get_active() + self.config.save() + def on_cursor_blink_toggled(self, widget): """Cursor blink setting changed""" self.config['cursor_blink'] = widget.get_active() diff --git a/terminatorlib/terminal.py b/terminatorlib/terminal.py index aa8d1399..e35fbb01 100755 --- a/terminatorlib/terminal.py +++ b/terminatorlib/terminal.py @@ -77,6 +77,10 @@ class Terminal(gtk.VBox): TARGET_TYPE_VTE = 8 + MOUSEBUTTON_LEFT = 1 + MOUSEBUTTON_MIDDLE = 2 + MOUSEBUTTON_RIGHT = 3 + terminator = None vte = None terminalbox = None @@ -895,17 +899,24 @@ class Terminal(gtk.VBox): # Suppress double-click behavior return True - if event.button == 1: + if self.config['putty_paste_style']: + btn_to_paste = self.MOUSEBUTTON_RIGHT + btn_to_context_menu = self.MOUSEBUTTON_MIDDLE + else: + btn_to_paste = self.MOUSEBUTTON_MIDDLE + btn_to_context_menu = self.MOUSEBUTTON_RIGHT + + if event.button == self.MOUSEBUTTON_LEFT: # Ctrl+leftclick on a URL should open it if event.state & gtk.gdk.CONTROL_MASK == gtk.gdk.CONTROL_MASK: url = self.check_for_url(event) if url: self.open_url(url, prepare=True) - elif event.button == 2: + elif event.button == btn_to_paste: # middleclick should paste the clipboard self.paste_clipboard(True) return(True) - elif event.button == 3: + elif event.button == btn_to_context_menu: # rightclick should display a context menu if Ctrl is not pressed if event.state & gtk.gdk.CONTROL_MASK == 0: self.popup_menu(widget, event)