Merge lp:~pearce/terminator/gtk3-new-tab-dir into lp:terminator/gtk3

Proposed by judgedreads
Status: Rejected
Rejected by: Stephen Boddy
Proposed branch: lp:~pearce/terminator/gtk3-new-tab-dir
Merge into: lp:terminator/gtk3
Diff against target: 24 lines (+6/-1)
1 file modified
terminatorlib/terminal.py (+6/-1)
To merge this branch: bzr merge lp:~pearce/terminator/gtk3-new-tab-dir
Reviewer Review Type Date Requested Status
Stephen Boddy Disapprove
Review via email: mp+254498@code.launchpad.net

Description of the change

I added a default directory for new tabs in case the vte method fails to get the cwd.

To post a comment you must log in.
Revision history for this message
Stephen Boddy (stephen-j-boddy) wrote :

I didn't see this merge request before I fixed the issue myself. As far as I can see the get_current_directory_uri is completely broken (at least in Python). It only ever returns a None for me, causing tabs to fail, and splits to not inherit the primary terminals directory. I reverted to the trunk method, which while kind of ugly, at least works reliably. See http://bazaar.launchpad.net/~gnome-terminator/terminator/gtk3/revision/1538

Thanks for the contributions.

review: Disapprove

Unmerged revisions

1530. By judgedreads <email address hidden>

set a default directory for new tabs

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'terminatorlib/terminal.py'
--- terminatorlib/terminal.py 2015-03-02 21:03:08 +0000
+++ terminatorlib/terminal.py 2015-03-29 18:52:00 +0000
@@ -27,6 +27,7 @@
27from signalman import Signalman27from signalman import Signalman
28import plugin28import plugin
29from terminatorlib.layoutlauncher import LayoutLauncher29from terminatorlib.layoutlauncher import LayoutLauncher
30import cwd
3031
31# pylint: disable-msg=R090432# pylint: disable-msg=R0904
32class Terminal(Gtk.VBox):33class Terminal(Gtk.VBox):
@@ -190,7 +191,11 @@
190191
191 def get_cwd(self):192 def get_cwd(self):
192 """Return our cwd"""193 """Return our cwd"""
193 return(GLib.filename_from_uri(self.vte.get_current_directory_uri())[0])194 try:
195 return(GLib.filename_from_uri(self.vte.get_current_directory_uri())[0])
196 except TypeError:
197 # Sensible default if vte method fails
198 return cwd.get_default_cwd()
194199
195 def close(self):200 def close(self):
196 """Close ourselves"""201 """Close ourselves"""

Subscribers

People subscribed via source and target branches

to status/vote changes: