thoughtbot / parity

Shell commands for development, staging, and production parity for Heroku apps
https://thoughtbot.com
MIT License
895 stars 57 forks source link

Use `Kernel.exec` for long-running processes #98

Closed geoffharcourt closed 8 years ago

geoffharcourt commented 8 years ago

In #79, @bernerdschaefer raised the issue that for long-running processes like log-tailing and consoles that parity was responding to Control-C and terminating the process rather than letting the remote session handle the input.

This change updates Environment#run_via_cli to use Kernel.exec rather than Kernel.system, which replaces the current process with the desired command. We aren't replacing all uses of Kernel.system, as some of our commands are multi-step and would not successfully complete if interrupted by an non-final command being invoked though exec. This solution should give better results for consoles and other long-running tasks.

http://ruby-doc.org/core-2.3.1/Kernel.html#method-i-exec

Close #79.

geoffharcourt commented 8 years ago

Waiting for #97 to merge before introducing this PR.

cc: @bernerdschaefer.

JoelQ commented 8 years ago

👍