Skip to content
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
Merged

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

merged 1 commit into from Jul 8, 2013

Conversation

matthutchinson
Copy link
Member

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!

…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 lolcommits:master Jul 8, 2013
@mroth
Copy link
Member

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
Copy link
Member Author

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

@mroth
Copy link
Member

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 }
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should redirect STDOUT from within the child process.

@matthutchinson
Copy link
Member Author

👍 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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants