diff --git a/ChangeLog b/ChangeLog index dcd6c319..2f9934f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -23,6 +23,9 @@ terminator 0.9: * Support encodings a-la GNOME Terminal * Move python support code to a terminatorlib module * Many other bug fixes and wider compatibility with GNOME Terminal + * Add support to cycle term within the same tab. Closes LP#238205. + This can be disabled by setting cycle_term_tab to False in + ~/.config/terminator/config terminator 0.8.1: * Fixed ChangeLog diff --git a/doc/terminator.1 b/doc/terminator.1 index 1d176093..8c4b35ae 100644 --- a/doc/terminator.1 +++ b/doc/terminator.1 @@ -69,10 +69,12 @@ Move first VPaned handle \fBDown\fR. Hide/Show \fBS\fRcrollbar. .TP .B Ctrl+Shift+N -Move to \fBn\fRext terminal. +Move to \fBn\fRext terminal within the same tab, use Ctrl+Shift+PageDown to move to the next tab. +If \fBcycle_term_tab\fR is \fBFalse\fR, cycle within the same tab will be disabled .TP .B Ctrl+Shift+P -Move to \fBp\fRrevious terminal. +Move to \fBp\fRrevious terminal within the same tab, use Ctrl+Shift+PageUp to move to the previous tab. +If \fBcycle_term_tab\fR is \fBFalse\fR, cycle within the same tab will be disabled .TP .B Ctrl+Shift+W Close the current terminal. diff --git a/doc/terminator_config.5 b/doc/terminator_config.5 index 162b73f7..63bb89e8 100644 --- a/doc/terminator_config.5 +++ b/doc/terminator_config.5 @@ -129,5 +129,9 @@ Default value: \fB-1\fR .B f11_modifier If this is set to true, the fullscreen keyboard shortcut changes from F11 (like many GNOME apps) to Ctrl-Shift-F11 (useful if you use terminal applications which expect to receive F11. Default value: \fBFalse\fR +.TP +.B cycle_term_tab +If this is set to true, when switching to the next/previous term, terminator will cycle within the same tab. Ctrl-Shift-PageUp/PageDown can then be used to move from one tab to the other one. +Default value: \fBTrue\fR .SH "SEE ALSO" .BR gnome\-terminal(1) diff --git a/terminator b/terminator index 8d77454d..bd19b5c2 100755 --- a/terminator +++ b/terminator @@ -1472,14 +1472,23 @@ class Terminator: return True return False + def go_next (self, term): current = self.term_list.index (term) - next = current - - if current == len (self.term_list) - 1: - next = 0 - else: - next += 1 + next = None + if self.conf.cycle_term_tab: + notebookpage = self.get_first_notebook_page(term) + if notebookpage: + last = self._notebook_last_term(notebookpage[1]) + first = self._notebook_first_term(notebookpage[1]) + if term == last: + next = self.term_list.index(first) + + if next is None: + if current == len (self.term_list) - 1: + next = 0 + else: + next = current + 1 nextterm = self.term_list[next] @@ -1491,12 +1500,21 @@ class Terminator: def go_prev (self, term): current = self.term_list.index (term) - previous = current + previous = None + + if self.conf.cycle_term_tab: + notebookpage = self.get_first_notebook_page(term) + if notebookpage: + last = self._notebook_last_term(notebookpage[1]) + first = self._notebook_first_term(notebookpage[1]) + if term == first: + previous = self.term_list.index(last) - if current == 0: - previous = len (self.term_list) - 1 - else: - previous -= 1 + if previous is None: + if current == 0: + previous = len (self.term_list) - 1 + else: + previous = current - 1 #self.window.set_title(self.term_list[previous]._vte.get_window_title()) previousterm = self.term_list[previous] diff --git a/terminatorlib/config.py b/terminatorlib/config.py index d7d9cc1b..b842af1e 100755 --- a/terminatorlib/config.py +++ b/terminatorlib/config.py @@ -124,6 +124,7 @@ class TerminatorConfValuestore: 'focus_on_close' : 'auto', 'f11_modifier' : False, 'force_no_bell' : False, + 'cycle_term_tab' : True, } def __getattr__ (self, keyname):