53

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

2
  • 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
    Commented Jul 9, 2010 at 18:47
  • Do you still have this problem?
    – Daniel Beck
    Commented Dec 9, 2010 at 12:50

3 Answers 3

79

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.

8
  • 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
    Commented Jul 6, 2010 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
    Commented Jul 6, 2010 at 17:57
  • Thanks, but that also didn't work: i.imgur.com/cCo49.png
    – Bemmu
    Commented Jul 8, 2010 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
    Commented Jul 9, 2010 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
    Commented Jul 12, 2010 at 20:33
0

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.
0

What worked for me on my Mac was:

Terminal>Shell>Reset or you can use the shortcut (Option+Command+R)

1
  • 1
    Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Sep 8, 2022 at 16:30

You must log in to answer this question.

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