Terminal refresh problems

Fellow FreeBSD users,

I'm using FreeBSD 12.1 RELEASE GENERIC. Under X when I type a command on the last line of a terminal, I often don't get any output. When I generate an event which triggers a refresh, the output finally appears, so I know it was there to start with. For example, if I move my mouse all across the terminal window, it refreshes the lines that the mouse swiped through. However, until then I can't see the output. This does not happen deterministically or every time, but often enough that it's a nuisance. It happens both with xfce and mate terminals, but never with plain xterm. Does anyone know what's going on and how to fix it?