Tweaking some mailcap definitions.

This commit is contained in:
Michael Lazar
2016-07-24 13:47:50 -07:00
parent 703ccca5a3
commit a115c7f423
3 changed files with 11 additions and 6 deletions

View File

@@ -354,21 +354,25 @@ class Terminal(object):
return self.open_browser(url)
_logger.info('Executing command: %s', command)
if 'copiousoutput' in entry:
# TODO: open in pager
pass
elif 'needsterminal' in entry:
needs_terminal = 'needsterminal' in entry
copious_output = 'copiousoutput' in entry
if needs_terminal or copious_output:
# Blocking, pause rtv until the process returns
with self.suspend():
os.system('clear')
p = subprocess.Popen(
[command], stderr=subprocess.PIPE,
universal_newlines=True, shell=True)
code = p.wait()
if copious_output:
six.moves.input('Press any key to continue')
if code != 0:
_, stderr = p.communicate()
_logger.warning(stderr)
self.show_notification(
'Program exited with status=%s\n%s' % (code, stderr))
else:
# Non-blocking, open a background process
with self.loader('Opening page', delay=0):