[texshop] Some source code

Richard Koch koch at math.uoregon.edu
Wed Sep 4 00:24:50 CEST 2019


Folks,

I do not  know if version 4.34 fixes the halt bug because people haven't had time to test. But I thought I'd satisfy curiosity about the changes.

At the TUG Conference, I became convinced that this is really an Apple bug. So I'd have to file a bug report. But Apple engineers are busy, so bug reports have a far better chance of getting action if a small sample program accompanies the report.

Therefore over Labor Day I constructed a very, very small version of TeXShop, called NSTaskTest. It has only six source files, each with less than a page of code. The program shows an editable source window, an output pdf window, and a console window. The program window has a Typeset button,
a Kill Aux button, and a popup menu listing all programs in ~/Library/NSTaskTest/Engines. This folder, containing both Engines and bin, is a full copy of the similar folders in TeXShop, except that I also created engines for Plain TeX, LaTeX, pdftex, pdflatex, Make Index, and BibTeX. This means that the full range of typesetting available in TeXShop is also available in this small program.

I carefully documented thecode. When it was done, I confirmed that the "sudden halt" bug was still present, absolving TeXShop of most of the blame for the bug.

The Typesetting code is confined to a single page of source. I tried to use the latest versions of all Cocoa calls, so Apple wouldn't write back that I was using deprecated code.

On Monday night, I made a last pass through Google to see if any web page talked about the halt bug or had suggested revised code. I found an obscure page from 2011, and it had one routine that was different than my code. But that routine was created, according to the web page, to handle blocking issues when reading pipes. So I added that routine to my code as an optional extra;
to compile without it, remove the FANCYPIPES definition.

I've just put the full source code for this sample on my site, and you can get it via

	https://pages.uoregon.edu/koch/NSTaskTest.zip

Reading the sample will show exactly what I changed in TeXShop 4.34, and why.

Richard Koch
koch at uoregon.edu


More information about the texshop mailing list