Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've a bash script I use to run XCode on OSX, which takes several minutes. I can't find the key command to stop it if I realise an error... on DOS I'm used to CTRL+C/CTRL+Z but neither seems to work. What am i looking for (on the standard OS X terminal)?

share|improve this question
1  
ctrl C should send sig-term (this signal can be trapped), and ctrl z send sig stop (both (all) key sequences can be blocked.) You need to set keyboard focus to terminal first. (this comment is for any generic Unix system) –  richard Sep 30 '12 at 19:40
    
@richard Ctrl-C sends SIGINT, not SIGTERM. SIGINT should terminate the process –  Rich Homolka Oct 1 '12 at 18:27

3 Answers 3

You can try these solutions :

  • try this keyboad combo : ctrl+altgr+8
  • open a new terminal and run pkill -f script_name
share|improve this answer
    
These are not applicable to OS X. –  Gordon Davisson Sep 30 '12 at 20:49

If ctrl + C isn't working for you, you can open a new Terminal tab and type

killall [process name]

where [process name] is the name of your bash script (you can find this in OS X's Activity Monitor).

share|improve this answer

There are a few keypresses that should help you here.

Ctrl-C should send the foreground process SIGINT, and that should terminate the process unless you trap the signal with something like trap INT ... in your shell code.

Ctrl-Z should send SIGSTOP, which would pause your process, again unless you trap your signals.

The mapping of key sequences jumps through some hoops, including terminal settings. What does stty -a say on your computer? Look in the output for intr, that's the keypress that should trigger SIGINT. If nothing is set, you need to set it, something like stty intr ^C

As others have said, you can kill the process from another window as well.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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