iTerm2 Error – Red Lines and Session Ending Message

erroritermpython

I've been experimenting with threading and running bits of python from iTerm in MacOS yesterday. Today I opened iTerm and two windows opened, one with thick red lines inside it.
I received a Warning message from MacOS:

A session ended very soon after starting. Check that the command in profile “Default” is correct.

I said OK, the window with the red closed immediately, and I quit iTerm.

Question: What is really happening here? I've never seen red lines appear in iTerm2 or a session close immediately upon starting. Is this just "one of those things" or could something be seriously wrong that needs attention?

I only have one profile, called default.


enter image description here


edit: after coaching in comments, I restarted iTerm2, same red lines. Engaged a second brain cell and realized I can move the error message out of the way, revealing the message in red in the iTerm2 window: Broken Pipe

enter image description here

Best Answer

I've seen this several times. It's caused by exiting an iTerm window. If you type exit in the window you'll be able to reproduce this behavior. I would check whatever command executes when iterm opens. This is defined in preferences.