# MathKernel with -noprompt hangs indefinitely when converting simple TeX expression

If I enter

MathKernel -noprompt -run 'ToExpression["1", TeXForm]; Exit[]'


the kernel hangs, apparently while running TeX.exe as a mathlink (see below). But when I remove -noprompt, it runs just fine. Similar results hold if I pass these commands (to either MathKernel or MathematicaScript) as a script.

Alternatively, even with -noprompt, any of the other formats accepted by ToExpression work just fine.

Any ideas why this happens?

Rather than printing the output, I could just write to file and send all the prompt garbage to /dev/null, but this really doesn't fit into my tool chain very well. So I'd appreciate any solutions or workarounds. I'm running Mathematica 9.0 for Mac OS X x86 (64-bit) on OS X 10.6.8.

My evidence for believing that it's TeX.exe causing the problem is that my processes look like this

2772 s000  S+     0:00.28 /Applications/Local/Mathematica.app/Contents/MacOS/MathKernel -noprompt -run Print[ToExpression["1", TeXForm]];Exit[]

Now, without -noprompt, I also see TeX.exe in the process list with the exact same arguments. But it's only there briefly, and it returns normally. Also, I can run file TeX.exe, and see that it is indeed a Mac executable (not Windows, as the name would suggest).
A workaround is to put the commands in a text file (file.m) and run it using math -script file.m –  Szabolcs Oct 1 '13 at 23:07