MacOS – Terminal window displays odd text after being resized

macosterminal

If I open a terminal window, and then shrink it as far left as possible, and then enlarge it again, it displays some odd text, including some of the letters in my hostname:

Error Screenshot

Any way to fix this?

Note: I'm guessing this is a bug, since when I go fullscreen, and then go back to a window, it goes back to normal and won't happen again.

Update: Some other weird stuff happens when I resize the window from using commands within the window.

Best Answer

It's a bug caused by Terminal's automatic text rewrapping combined with your shell's SIGWINCH re-rendering. If you just want to clear the corrupted text, you can use Edit->Clear All (default shortcut + K ) to clear the window, leaving only the prompt.