mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-05 17:00:58 +01:00
Captures correct process exit codes or signal info.
This commit is contained in:
parent
6c4b8937e5
commit
050d0bbfd2
1 changed files with 8 additions and 1 deletions
|
@ -45,7 +45,7 @@ if ON_WINDOWS:
|
|||
obj = job['obj']
|
||||
if job['bg']:
|
||||
return
|
||||
while obj.returncode is None:
|
||||
while (obj.returncode, obj.signal) == (None, None):
|
||||
try:
|
||||
obj.wait(0.01)
|
||||
except TimeoutExpired:
|
||||
|
@ -124,6 +124,13 @@ else:
|
|||
print() # get a newline because ^C will have been printed
|
||||
if obj.poll() is not None:
|
||||
builtins.__xonsh_active_job__ = None
|
||||
# s is in terms of subprocess semantics, not os.W* format.
|
||||
if s < 0:
|
||||
obj.signal = abs(s)
|
||||
obj.returncode = None
|
||||
else:
|
||||
obj.returncode = rtn
|
||||
obj.signal = None
|
||||
_give_terminal_to(_shell_pgrp) # give terminal back to the shell
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue