eoptasks: do not start if already running in tmux

This commit is contained in:
Frédéric Péters 2019-01-09 17:56:24 +01:00
parent cdc4dbc666
commit b75877298b
1 changed files with 4 additions and 0 deletions

View File

@ -268,6 +268,10 @@ if not args.cmd:
sys.exit(1)
def init_tmux_session():
if os.environ.get('TMUX'): # already in a tmux
sys.stderr.write('Cannot run embedded in tmux\n')
sys.exit(1)
tmux_session_name = 's%s' % random.randrange(1000)
server_address = '/tmp/.eoptasks.%s' % tmux_session_name
try: