diff --git a/terminatorlib/optionparse.py b/terminatorlib/optionparse.py index 08aececb..8ad7899b 100755 --- a/terminatorlib/optionparse.py +++ b/terminatorlib/optionparse.py @@ -94,7 +94,6 @@ WM_WINDOW_ROLE property on the window') sys.exit(1) configobj.options_set(options) - # FIXME: Map all the other bits of options to configobj if util.DEBUG == True: dbg('OptionParse::parse_options: command line options: %s' % options) diff --git a/terminatorlib/terminal.py b/terminatorlib/terminal.py index ff19c302..534fd009 100755 --- a/terminatorlib/terminal.py +++ b/terminatorlib/terminal.py @@ -948,18 +948,29 @@ for %s (%s)' % (name, urlplugin.__class__.__name__)) 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'] - shell = util.shell_lookup() - - if self.config['login_shell']: - args.insert(0, "-%s" % shell) + if type(command) is list: + shell = util.path_lookup(command[0]) + args = command else: - args.insert(0, shell) + shell = util.shell_lookup() - if command is not None: - args += ['-c', command] + if self.config['login_shell']: + args.insert(0, "-%s" % shell) + else: + args.insert(0, shell) + + if command is not None: + args += ['-c', command] if shell is None: self.vte.feed(_('Unable to find a shell')) @@ -970,6 +981,7 @@ for %s (%s)' % (name, urlplugin.__class__.__name__)) except AttributeError: pass + dbg('Forking shell: "%s" with args: %s' % (shell, args)) self.pid = self.vte.fork_command(command=shell, argv=args, envv=[], loglastlog=login, logwtmp=update_records, logutmp=update_records, directory=self.cwd) diff --git a/terminatorlib/util.py b/terminatorlib/util.py index 143bc6f8..bb812839 100755 --- a/terminatorlib/util.py +++ b/terminatorlib/util.py @@ -101,7 +101,7 @@ def path_lookup(command): dbg('path_lookup: PATH not set in environment, using fallbacks') 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: target = os.path.join(path, command)