Skip to content

Commit

Permalink
commandrunner: Forward KeyboardInterrupt to command
Browse files Browse the repository at this point in the history
Some commands, notably gdb, use ctrl+c themselves to perform actions
without exiting. Instead of making meson exit and thus, kill the
subprocess, ignore the KeyboardInterrupt and continue waiting for
the child.
  • Loading branch information
fiam authored and jpakkane committed Nov 17, 2019
1 parent 1baa1c9 commit ffa9459
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mesonbuild/scripts/commandrunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,12 @@ def run(args):
command = args[4]
arguments = args[5:]
pc = run_command(src_dir, build_dir, subdir, meson_command, command, arguments)
pc.wait()
while True:
try:
pc.wait()
break
except KeyboardInterrupt:
pass
return pc.returncode

if __name__ == '__main__':
Expand Down

0 comments on commit ffa9459

Please sign in to comment.