Apply some policy to the original cwd we inherit - if it's / then our parent process is probably some kind of app launcher, so we'll try to be helpful and make our cwd be ~
This commit is contained in:
parent
6426236bed
commit
682f0bd3f7
|
@ -52,7 +52,7 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
MAKER = Factory()
|
MAKER = Factory()
|
||||||
TERMINATOR = Terminator()
|
TERMINATOR = Terminator()
|
||||||
TERMINATOR.origcwd = ORIGCWD
|
TERMINATOR.set_origcwd(ORIGCWD)
|
||||||
TERMINATOR.reconfigure()
|
TERMINATOR.reconfigure()
|
||||||
try:
|
try:
|
||||||
TERMINATOR.create_layout(OPTIONS.layout)
|
TERMINATOR.create_layout(OPTIONS.layout)
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
"""terminator.py - class for the master Terminator singleton"""
|
"""terminator.py - class for the master Terminator singleton"""
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
|
import os
|
||||||
import gtk
|
import gtk
|
||||||
|
|
||||||
from borg import Borg
|
from borg import Borg
|
||||||
|
@ -63,6 +64,13 @@ class Terminator(Borg):
|
||||||
if self.gnome_client is None:
|
if self.gnome_client is None:
|
||||||
self.attempt_gnome_client()
|
self.attempt_gnome_client()
|
||||||
|
|
||||||
|
def set_origcwd(self, cwd):
|
||||||
|
"""Store the original cwd our process inherits"""
|
||||||
|
if cwd == '/':
|
||||||
|
cwd = os.path.expanduser('~')
|
||||||
|
os.chdir(cwd)
|
||||||
|
self.origcwd = cwd
|
||||||
|
|
||||||
def attempt_gnome_client(self):
|
def attempt_gnome_client(self):
|
||||||
"""Attempt to find a GNOME Session to register with"""
|
"""Attempt to find a GNOME Session to register with"""
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue