New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding new LOLCOMMITS_FORK (or --fork) option to fork the runner capturing #109

Merged
merged 1 commit into from Jul 8, 2013

Conversation

Projects
None yet
3 participants
@matthutchinson
Collaborator

matthutchinson commented Jul 3, 2013

Use the LOLCOMMITS_FORK env variable or --fork argument in the lolcommits command to fork the runner capturing process to a new thread.

This helps when the capture is slow and you want to return to a usable terminal prompt right away. Using fork, some plugins may prompt in your terminal after the initial capture. I also updated the README.md to explain this.

This PR is particularly useful for capturing animated gifs!

Adding new LOLCOMMITS_FORK (or --fork) option to fork the runner capt…
…uring

Use the LOLCOMMITS_FORK env variable or --fork argument in the lolcommits
command to fork the runner capturing process to a new thread.  Helps when the
capture is slow and you want to return to a usable terminal prompt right away.

Using fork, some plugins may prompt in your terminal after the initial capture.
README also updated to explain this.

@mroth mroth merged commit d25ca19 into mroth:master Jul 8, 2013

1 check passed

default The Travis CI build passed
Details
@mroth

This comment has been minimized.

Show comment
Hide comment
@mroth

mroth Jul 8, 2013

Owner

This has been merged. I added a test in 8fd8f1c to verify it doesn't break capture.

(If you can think of a way to have the test actually verify we background successfully, that would be ideal!)

Owner

mroth commented Jul 8, 2013

This has been merged. I added a test in 8fd8f1c to verify it doesn't break capture.

(If you can think of a way to have the test actually verify we background successfully, that would be ideal!)

mroth added a commit that referenced this pull request Jul 8, 2013

@matthutchinson

This comment has been minimized.

Show comment
Hide comment
@matthutchinson

matthutchinson Jul 8, 2013

Collaborator

Thanks @mroth, I'll look into adding a test for that asap.

Collaborator

matthutchinson commented Jul 8, 2013

Thanks @mroth, I'll look into adding a test for that asap.

@mroth

This comment has been minimized.

Show comment
Hide comment
@mroth

mroth Jul 8, 2013

Owner

Released to rubygems as part of v0.4.5

Owner

mroth commented Jul 8, 2013

Released to rubygems as part of v0.4.5

def fork_me?(&block)
if Choice.choices[:fork] || ENV['LOLCOMMITS_FORK']
fork { yield block }

This comment has been minimized.

@fuadsaud

fuadsaud Jul 8, 2013

Maybe we should redirect STDOUT from within the child process.

@fuadsaud

fuadsaud Jul 8, 2013

Maybe we should redirect STDOUT from within the child process.

@matthutchinson

This comment has been minimized.

Show comment
Hide comment
@matthutchinson

matthutchinson Jul 19, 2013

Collaborator

👍 going to submit a new PR now to add a better test and deal with the STDOUT issue.

Collaborator

matthutchinson commented Jul 19, 2013

👍 going to submit a new PR now to add a better test and deal with the STDOUT issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment