Restore -e and -x support

This commit is contained in:
Chris Jones 2010-01-18 22:56:43 +00:00
parent e6ad61831d
commit bdbe359767
3 changed files with 21 additions and 10 deletions

View File

@ -94,7 +94,6 @@ WM_WINDOW_ROLE property on the window')
sys.exit(1) sys.exit(1)
configobj.options_set(options) configobj.options_set(options)
# FIXME: Map all the other bits of options to configobj
if util.DEBUG == True: if util.DEBUG == True:
dbg('OptionParse::parse_options: command line options: %s' % options) dbg('OptionParse::parse_options: command line options: %s' % options)

View File

@ -948,18 +948,29 @@ for %s (%s)' % (name, urlplugin.__class__.__name__))
self.vte.grab_focus() self.vte.grab_focus()
if self.config['use_custom_command']: options = self.config.options_get()
if options.command:
command = options.command
options.command = None
elif options.execute:
command = options.execute
options.execute = None
elif self.config['use_custom_command']:
command = self.config['custom_command'] command = self.config['custom_command']
shell = util.shell_lookup() if type(command) is list:
shell = util.path_lookup(command[0])
if self.config['login_shell']: args = command
args.insert(0, "-%s" % shell)
else: else:
args.insert(0, shell) shell = util.shell_lookup()
if command is not None: if self.config['login_shell']:
args += ['-c', command] args.insert(0, "-%s" % shell)
else:
args.insert(0, shell)
if command is not None:
args += ['-c', command]
if shell is None: if shell is None:
self.vte.feed(_('Unable to find a shell')) self.vte.feed(_('Unable to find a shell'))
@ -970,6 +981,7 @@ for %s (%s)' % (name, urlplugin.__class__.__name__))
except AttributeError: except AttributeError:
pass pass
dbg('Forking shell: "%s" with args: %s' % (shell, args))
self.pid = self.vte.fork_command(command=shell, argv=args, envv=[], self.pid = self.vte.fork_command(command=shell, argv=args, envv=[],
loglastlog=login, logwtmp=update_records, loglastlog=login, logwtmp=update_records,
logutmp=update_records, directory=self.cwd) logutmp=update_records, directory=self.cwd)

View File

@ -101,7 +101,7 @@ def path_lookup(command):
dbg('path_lookup: PATH not set in environment, using fallbacks') dbg('path_lookup: PATH not set in environment, using fallbacks')
paths = ['/usr/local/bin', '/usr/bin', '/bin'] paths = ['/usr/local/bin', '/usr/bin', '/bin']
dbg('path_lookup: Using %d paths: %s', (len(paths), paths)) dbg('path_lookup: Using %d paths: %s' % (len(paths), paths))
for path in paths: for path in paths:
target = os.path.join(path, command) target = os.path.join(path, command)