Enable switch to next/previous term within the same tab

* closes LP#238205
This commit is contained in:
Emmanuel Bretelle 2008-06-17 21:40:04 +01:00
parent 9a499cf9ff
commit 5254ede2da
5 changed files with 41 additions and 13 deletions

View File

@ -23,6 +23,9 @@ terminator 0.9:
* Support encodings a-la GNOME Terminal * Support encodings a-la GNOME Terminal
* Move python support code to a terminatorlib module * Move python support code to a terminatorlib module
* Many other bug fixes and wider compatibility with GNOME Terminal * 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: terminator 0.8.1:
* Fixed ChangeLog * Fixed ChangeLog

View File

@ -69,10 +69,12 @@ Move first VPaned handle \fBDown\fR.
Hide/Show \fBS\fRcrollbar. Hide/Show \fBS\fRcrollbar.
.TP .TP
.B Ctrl+Shift+N .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 .TP
.B Ctrl+Shift+P .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 .TP
.B Ctrl+Shift+W .B Ctrl+Shift+W
Close the current terminal. Close the current terminal.

View File

@ -129,5 +129,9 @@ Default value: \fB-1\fR
.B f11_modifier .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. 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 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" .SH "SEE ALSO"
.BR gnome\-terminal(1) .BR gnome\-terminal(1)

View File

@ -1472,14 +1472,23 @@ class Terminator:
return True return True
return False return False
def go_next (self, term): def go_next (self, term):
current = self.term_list.index (term) current = self.term_list.index (term)
next = current 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 current == len (self.term_list) - 1: if next is None:
next = 0 if current == len (self.term_list) - 1:
else: next = 0
next += 1 else:
next = current + 1
nextterm = self.term_list[next] nextterm = self.term_list[next]
@ -1491,12 +1500,21 @@ class Terminator:
def go_prev (self, term): def go_prev (self, term):
current = self.term_list.index (term) current = self.term_list.index (term)
previous = current previous = None
if current == 0: if self.conf.cycle_term_tab:
previous = len (self.term_list) - 1 notebookpage = self.get_first_notebook_page(term)
else: if notebookpage:
previous -= 1 last = self._notebook_last_term(notebookpage[1])
first = self._notebook_first_term(notebookpage[1])
if term == first:
previous = self.term_list.index(last)
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()) #self.window.set_title(self.term_list[previous]._vte.get_window_title())
previousterm = self.term_list[previous] previousterm = self.term_list[previous]

View File

@ -124,6 +124,7 @@ class TerminatorConfValuestore:
'focus_on_close' : 'auto', 'focus_on_close' : 'auto',
'f11_modifier' : False, 'f11_modifier' : False,
'force_no_bell' : False, 'force_no_bell' : False,
'cycle_term_tab' : True,
} }
def __getattr__ (self, keyname): def __getattr__ (self, keyname):