From 5e785094999548817b5303edd8e2b61ad686a807 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Thu, 26 Mar 2009 10:36:47 +0000 Subject: [PATCH] Fix scrolling on patched VTEs. Note that this will only work if the patched VTEs also have python support for their modifications. Closes LP #291184 --- doc/terminator_config.5 | 4 ++++ terminatorlib/config.py | 1 + terminatorlib/prefs_profile.py | 2 +- terminatorlib/terminatorterm.py | 3 +++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/terminator_config.5 b/doc/terminator_config.5 index f624fc5a..4f081548 100644 --- a/doc/terminator_config.5 +++ b/doc/terminator_config.5 @@ -127,6 +127,10 @@ Default value: \fBTrue\fR If true, whenever there's new output the terminal will scroll to the bottom. Default value: \fBTrue\fR .TP +.B alternate_screen_scroll \fR(boolean) +Whether or not the mouse wheel scrolls alternate screen buffers (man, vim, mutt, etc). This is the default behavior of VTE, however Ubuntu and possbly other distributions feature patched versions of VTE where this functionality is optional. The option only effects the patched versions of VTE, otherwise it is ignored. +Default value: \fBTrue\fR +.TP .B scrollback_lines Number of scrollback lines to keep around. You can scroll back in the terminal by this number of lines; lines that don't fit in the scrollback are discarded. Be careful with this setting; it's the primary factor in determining how much memory the terminal will use. Default value: \fB500\fR diff --git a/terminatorlib/config.py b/terminatorlib/config.py index 6d5913dd..69acd577 100755 --- a/terminatorlib/config.py +++ b/terminatorlib/config.py @@ -113,6 +113,7 @@ Defaults = { 'try_posix_regexp' : platform.system() != 'Linux', 'hide_tabbar' : False, 'scroll_tabbar' : False, + 'alternate_screen_scroll': True, 'keybindings' : { 'zoom_in' : 'plus', 'zoom_out' : 'minus', diff --git a/terminatorlib/prefs_profile.py b/terminatorlib/prefs_profile.py index 44fb646c..20e31788 100644 --- a/terminatorlib/prefs_profile.py +++ b/terminatorlib/prefs_profile.py @@ -10,7 +10,7 @@ class ProfileEditor: # lists of which settings to put in which tabs appearance = ['titlebars', 'titletips', 'allow_bold', 'audible_bell', 'visible_bell', 'urgent_bell', 'force_no_bell', 'background_darkness', 'background_type', 'background_image', 'cursor_blink', 'cursor_shape', 'font', 'scrollbar_position', 'scroll_background', 'use_system_font', 'use_theme_colors', 'enable_real_transparency'] colours = ['foreground_color','background_color', 'cursor_color', 'palette'] - behaviour = ['backspace_binding', 'delete_binding', 'emulation', 'scroll_on_keystroke', 'scroll_on_output', 'scrollback_lines', 'focus', 'focus_on_close', 'exit_action', 'word_chars', 'mouse_autohide', 'use_custom_command', 'custom_command', 'http_proxy', 'encoding'] + behaviour = ['backspace_binding', 'delete_binding', 'emulation', 'scroll_on_keystroke', 'scroll_on_output', 'alternate_screen_scroll', 'scrollback_lines', 'focus', 'focus_on_close', 'exit_action', 'word_chars', 'mouse_autohide', 'use_custom_command', 'custom_command', 'http_proxy', 'encoding'] globals = ['fullscreen', 'maximise', 'borderless', 'handle_size', 'cycle_term_tab', 'close_button_on_tab', 'tab_position', 'copy_on_selection', 'extreme_tabs', 'try_posix_regexp'] # metadata about the settings diff --git a/terminatorlib/terminatorterm.py b/terminatorlib/terminatorterm.py index 80fad217..82e5e0de 100755 --- a/terminatorlib/terminatorterm.py +++ b/terminatorlib/terminatorterm.py @@ -761,6 +761,9 @@ text/plain elif self.scrollbar_position == 'left': self._termbox.reorder_child (self._scrollbar, 0) + if hasattr (self._vte, "set_alternate_screen_scroll"): + self._vte.set_alternate_screen_scroll (self.conf.alternate_screen_scroll) + # Set our sloppiness self.focus = self.conf.focus