diff --git a/qubesadmin/tools/qvm_run.py b/qubesadmin/tools/qvm_run.py index 7045a065..c314b96a 100644 --- a/qubesadmin/tools/qvm_run.py +++ b/qubesadmin/tools/qvm_run.py @@ -483,6 +483,9 @@ def main(args=None, app=None): try: for vm, proc in procs: this_retcode = proc.wait() + if this_retcode < 0: + this_retcode = 128 + abs(this_retcode) + if this_retcode and verbose > 0: print_no_color( "{}: command failed with code: {}".format( @@ -491,7 +494,7 @@ def main(args=None, app=None): file=sys.stderr, color=args.color_stderr, ) - retcode = max(retcode, proc.wait()) + retcode = max(retcode, this_retcode) except KeyboardInterrupt: for vm, proc in procs: with contextlib.suppress(ProcessLookupError):