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
1=== modified file 'terminatorlib/terminal.py'
2--- terminatorlib/terminal.py 2015-03-02 21:03:08 +0000
3+++ terminatorlib/terminal.py 2015-03-29 18:52:00 +0000
4@@ -27,6 +27,7 @@
5 from signalman import Signalman
6 import plugin
7 from terminatorlib.layoutlauncher import LayoutLauncher
8+import cwd
9
10 # pylint: disable-msg=R0904
11 class Terminal(Gtk.VBox):
12@@ -190,7 +191,11 @@
13
14 def get_cwd(self):
15 """Return our cwd"""
16- return(GLib.filename_from_uri(self.vte.get_current_directory_uri())[0])
17+ try:
18+ return(GLib.filename_from_uri(self.vte.get_current_directory_uri())[0])
19+ except TypeError:
20+ # Sensible default if vte method fails
21+ return cwd.get_default_cwd()
22
23 def close(self):
24 """Close ourselves"""

Subscribers

People subscribed via source and target branches

to status/vote changes: