Minimal example consists of two files:
fileA.tex:
\def\foo#1{#1} \foo{\endinput\input fileB.tex}% fileB.tex:
This is file B. \bye I assumed that compiling fileA.tex would lead to a file fileA.pdf which contains the phrase "This is file B."
I get this but during compilation TeX enters interactive mode.
When I just press return, then fileB.tex is loaded and compilation finishes.
My question is:
Why does TeX enter interactive mode?
I assumed \endinput\input fileB.tex would already be in the token-stream.
So \endinput would cause TeX not to read and tokenize things from fileA.tex any more.
As \input fileB.tex is already in the token-stream, that would be processed next and lead to TeX reading and tokenizing things from fileB.tex.
But why does TeX enter interactive mode before loading fileB.tex ?
Here is the console-output:
$ pdftex fileA.tex This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2019/dev/Debian) (preloaded format=pdftex) restricted \write18 enabled. entering extended mode (./fileA.tex) * (./fileB.tex [1{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] )</usr/shar e/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb> Output written on fileA.pdf (1 page, 11997 bytes). Transcript written on fileA.log.