When using cat to display a file without trailing newline, the last line can (sometimes) be seen very briefly and is then overwritten by the (left-)prompt.
Perhaps a non-empty line could be detected in which case the prompt either does not clear the line, or emits a newline first.