In my text editor, I have bound a shortcut key to deploy my code by invoking a command like

/usr/bin/open /Users/blahblah/run_deploy

That deploy script uploads my code to my server etc. I am using "open" so that I can see the output in a new terminal window in case there are any errors. Very convenient, but in the end it leaves the terminal window open with text "[Process completed]".

Any way to skip this and instead just automatically close the window?

Terminal process completed

  • 1
    Give that you've set Terminal to close the window when the shell exits, it sounds like a Terminal issue. Have you tried deleting the preference file com.apple.Terminal.plist from your Preferences folder and tried setting it again? – Chealion Jul 9 '10 at 18:47
  • Do you still have this problem? – Daniel Beck Dec 9 '10 at 12:50

In Terminal Preferences, in Profiles pane select the Profile you use (should say "default" under it's name), select sub-pane Shell and change «When the shell exits:» to «Close if the shell exited cleanly».

It will not hide the [Process completed] message, but will close the window if exit code was successful.

  • For some reason I cannot change the settings in that terminal window. If I change them in another terminal window and "use as default", still they are not used in the new terminal window. Here's what the new terminal window looks like: i.imgur.com/u3tk4.png – Bemmu Jul 6 '10 at 12:34
  • First to make testing faster run following: echo 'say hello' > test; chmod +x test (it will create executable which will say hello), running open test or double-clicking it in finder will run it with terminal by default. On your screenshot none of schemes is selected (don't know how, I can't unselect all of them), so select Basic as it is marked «Default», and set closing setting, then try running script. – tig Jul 6 '10 at 17:57
  • Thanks, but that also didn't work: i.imgur.com/cCo49.png – Bemmu Jul 8 '10 at 3:36
  • Which os version do you use (don't know if it can be related, I use 10.6.4)? Maybe this is due unread mail? Try using mail to read it. Maybe something wrong with logout? Do you have ~/.bash_logout file, if yes, what is inside? Try running bash -c exit && echo 'ok' — you should see 'ok', also try just run exit in new shell — it should close the window. Do you use window groups? i.imgur.com/thPNV.png – tig Jul 9 '10 at 14:56
  • 1
    Could you put a "killall Terminal" command at the end of your script or something? I know that'll close the window no matter what, but you can at least watch what's going on DURING the script's run (and you could also push the output to a log, just in case). – jrc03c Jul 12 '10 at 20:33

Repairing permissions via the Disk utility app solved the problem for me.

I kept seeing the error in the Console app:

20/08/2015 01:17:42.318 login[3291]: in pam_sm_open_session(): Unable to write the utmp record.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.