I use the iTerm terminal a lot and occasionally I'll run a script with an "exit" in it. When that statement executes I get 2 orange horizontal lines drawn the width of my iTerm window with the message "Broken Pipe". Why does an exit statement cause the window to lock? Is there a workaround for this?

When the window does lock-up is there any way to salvage it? Currently, I just close that window and open a new one.

I tried using the Terminal app but the window locks-up there as well.

  • 1
    exit ends the current shell - what do you expect terminal to do when there is no shell for it to run? – user151019 Sep 16 '18 at 22:16
  • I expected that it would gracefully quit in some way without locking up your terminal window. Unix has only been around more than 50 years. – jmh Sep 16 '18 at 22:38
  • What does how long Unix has been around have to do with it? It did "gracefully quit", exactly as you told it to. The terminal you're using is an application, inside it is another application. The one has terminated, the other has not. – Marc Wilson Sep 16 '18 at 23:34
  • Yea my bad. I realized how stupid my remark was after I posted it. – jmh Sep 17 '18 at 0:45
  • 1
    Simply using exit in your shell will not create a broken pipe. There may be something in your script that caused the error. To better help you, we would need to see the script itself. – Allan Sep 17 '18 at 2:08

You must log in to answer this question.

Browse other questions tagged .