MathText has side-effects on the Python interpreter
This is regarding the pyvista broke my shell issue in pyvista, since the bug that issue describes is really a VTK bug rather than a pyvista bug.
The pyvista issue can be summarized as follows: when the vtkMathTextFreeTypeTextRender is used after pyvista is imported, the shell stops printing output to stdout. This occurs because of unexpected side-effects involving vtkMatplotlibMathTextUtilities and vtkOutputWindow, and the only reason it occurred with pyvista specifically is because pyvista overrides the vtkOutputWindow.
To better demonstrate this issue, here is a minimal example in Python/VTK:
# test_mpl_side_effect.py
import vtk
# override vtkOutputWindow, like pyvista does
ow = vtk.vtkFileOutputWindow()
ow.SetFileName("vtklog.txt")
vtk.vtkOutputWindow.SetInstance(ow)
print("Hello World!")
# activate vtkMatplotlibMathTextUtilities
mplutil = vtk.vtkMatplotlibMathTextUtilities()
mplutil.IsAvailable()
print("Hello World, Too!")
Running this example shows only the first "Hello World". The second "Hello World" is not printed, because activating vtkMatplotlibTextUtilities causes the Python interpreter to start redirecting all of its output to the "output window" (in this case, a log file) instead of to the shell:
$ python test_mpl_side_effect.py
Hello World!
This side-effect of vtkMatplotlibTextUtilities is unexpected and is very confusing to users who encounter it. Using MathText in VTK shouldn't cause the Python shell to suddenly stop producing any output.