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

Merged
merged 1 commit into from Jul 8, 2013

Projects

None yet

3 participants

@matthutchinson
Collaborator

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!

@matthutchinson matthutchinson 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.
d25ca19
@mroth mroth merged commit d25ca19 into mroth:master Jul 8, 2013

1 check passed

default The Travis CI build passed
Details
@mroth
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 mroth added a commit that referenced this pull request Jul 8, 2013
@mroth update changelog to reflect #109 3679b55
@matthutchinson
Collaborator

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

@mroth
Owner
mroth commented Jul 8, 2013

Released to rubygems as part of v0.4.5

@fuadsaud fuadsaud commented on the diff Jul 8, 2013
bin/lolcommits
+
+ Launchy.open(runner.main_image)
+ else
+ runner = Lolcommits::Runner.new(:capture_delay => capture_delay,
+ :capture_device => capture_device,
+ :config => configuration,
+ :font => capture_font
+ )
+ runner.run
+ end
+ end
+end
+
+def fork_me?(&block)
+ if Choice.choices[:fork] || ENV['LOLCOMMITS_FORK']
+ fork { yield block }
@fuadsaud
fuadsaud Jul 8, 2013

Maybe we should redirect STDOUT from within the child process.

@matthutchinson
Collaborator

👍 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