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
* 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

View File

@ -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.

View File

@ -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)

View File

@ -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]

View File

@ -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):