Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
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 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
up vote 28 down vote accepted

In Terminal Preferences, in Settings pane select scheme you use, select sub-pane Shell and change «When the shell exits» to «Close if the shell exited cleanly». Though it will not hide [Process completed] message, but will close the window if exit code was successful.

share|improve this answer
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: – user16145 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: – user16145 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? – tig Jul 9 '10 at 14:56
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.
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .