At half moon when the sun is in the sky, why does the terminator of the moon appear not to be perpendicular to a line between the moon and the sun (which it must be)
A perpendicular to the terminator always passes considerably above the sun.
The terminator on the Moon is the line that divides day from night on the moon - the daylight side is that half of the Moon that is closer to, and illluminated by the Sun. The effect you mention is most apparent when the Sun and the Moon are widely separated in the Sky, eg when there is a half-moon. I think the solution to your question lies in the way that we perceive straight lines in a 3-dimensional situation. For example, if you were to stand on a infinitely long rail track, the parallel rails converge in the distance to either side of you, and thus must appear to curve around you.
We know the Sun, Moon and Earth lie in the flat disc of our solar system, which we see edge-on, so it should appear as a straight line - but this is projected on the sky as an arc. The Sun rises in the east, sets in the west, and its 'straight path' is seen as an arced path when projected onto the sky. The Moon follows the same route across the sky, and the further away it is along that arc from the sun, the more you’ll be off if you’re imagining the path of the light as a straight line across the sky.