reitzig / ltx2any

Yet another LaTeX build wrapper, with one or two nifty features
GNU General Public License v3.0
59 stars 4 forks source link

-d: CTRL+c does not cancel the build #82

Closed koppor closed 7 years ago

koppor commented 8 years ago

OS: Windows, ruby 2.2.4p230 (2015-12-16 revision 53155) [x64-mingw32].

I use C:\Ruby22-x64\bin\ruby ..\..\ltx2any\ltx2any.rb -d paper with Springer's LNCS template.

Waiting for file changes ... outputs Done if I press CTRL+c and continues trying to compile:

[ltx2any] Waiting for file changes ... Done

[ltx2any] Copying files to tmp ... Done
[ltx2any] PdfLaTeX(1) running ... Done
[ltx2any] PdfLaTeX(2) running ... Done
[ltx2any] PdfLaTeX(3) running ... Cancelled
[ltx2any] Waiting for file changes ...

Pressing CTRL+c very often results in following output:

[ltx2any] Waiting for file changes ... Done

[ltx2any] Copying files to tmp ... Done
[ltx2any] PdfLaTeX(1) running ... Error
[ltx2any] There were 0 errors and 0 warnings.
[ltx2any] No output generated, probably due to fatal errors.
[ltx2any] Assembling log files ... Done
[ltx2any] Log file generated at paper.log.md
[ltx2any] Waiting for file changes ... Done

[ltx2any] Copying files to tmp ... Done
[ltx2any] PdfLaTeX(1) running ... Cancelled
[ltx2any] Waiting for file changes ... 
akerbos commented 8 years ago

In the "waiting" state, CTRL+C is not supposed to exit the application. Press Enter, type quit and Enter again to quit. I'll make a note to include a hint at the prompt into the output.

That said, I don't quite understand which exception is thrown in Ruby when CTRL+C is pressed at which point. I did my best to provide a reasonable user experience. I may look at this again in the future when I overhaul the daemon mode.

akerbos commented 8 years ago

Looking at the code again, this is what I intended:

I messed up using the same exception for "files changed!" that CTRL+C issues -- my bad. Will fix.