Skip to content

Commit

Permalink
fix default behaviour of --spawn on X11-less TERMS
Browse files Browse the repository at this point in the history
this ensures that whenever X11 is not present
and external commands like calling the editor
are used in combination with the --spawn parameter,
they are *not* called in a new xterm and forced to
run in the same thread as alot.

cf issue #460
  • Loading branch information
pazz committed Jun 23, 2012
1 parent 66894a8 commit 2a7d1fd
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions alot/commands/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,14 @@ def __init__(self, cmd, stdin=None, shell=False, spawn=False,
logging.debug('got: %s' % res)
cmd, shell, self.in_thread = res
# otherwise if spawn requested and X11 is running
elif spawn and 'DISPLAY' in os.environ:
term_cmd = settings.get('terminal_cmd', '')
logging.info('spawn in terminal: %s' % term_cmd)
termcmdlist = split_commandstring(term_cmd)
cmd = termcmdlist + cmd
elif spawn:
if 'DISPLAY' in os.environ:
term_cmd = settings.get('terminal_cmd', '')
logging.info('spawn in terminal: %s' % term_cmd)
termcmdlist = split_commandstring(term_cmd)
cmd = termcmdlist + cmd
else:
thread = False

self.cmdlist = cmd
self.stdin = stdin
Expand Down

0 comments on commit 2a7d1fd

Please sign in to comment.