2.4 The Unresponsive Terminal


During your Unix session, your terminal may not respond when you type a command, or the display on your screen may stop at an unusual place. That's called a "hung" or "frozen" terminal or session. Note that most of the techniques in this section apply to a terminal window, but not to nonterminal windows such as a web browser.

A session can hang for several reasons. For instance, your computer can get too busy; the Terminal application has to wait its turn . In that case, your session resumes after a few moments. You should not try to "un-hang" the session by entering extra commands, because those commands will all take effect after Terminal comes back to life.

If your display becomes garbled, press Control-L. In the shell, this will clear the screen and display the prompt. In a full-screen program, such as a text editor, it will redraw the screen.


If the system doesn't respond for quite a while (how long that is depends on your individual situation; ask other users about their experiences), the following solutions usually work. Try the following steps in the order shown until the system responds:


Press the Return key once.

You may have typed text at a prompt (for example, a command line at a shell prompt) but haven't yet pressed Return to say that you're done typing and your text should be interpreted.


Try job control (see Chapter 7); type Control-Z.

This control key sequence suspends a program that may be running and gives you a shell prompt. Now you can enter the jobs command to find the program's name , then restart the program with fg or terminate it with kill .


Press Control-C or figs/command.gif - . .

This interrupts a program that may be running. (Unless the program is run in the background; as described in , Section 7.1 in Chapter 7, the shell waits for a background program to finish before giving a new prompt. A long-running background program may thus appear to hang the terminal.) If this doesn't work the first time, try it once more; doing it more than twice usually won't help.


Type Control-Q.

If output has been stopped with Control-S, this will restart it. Note that some systems will automatically issue Control-S if they need to pause output; this character may not have been typed from the keyboard.


Type Control-D once at the beginning of a new line.

Some programs (such as mail ) expect text from the user . A program may be waiting for an end-of-input character from you to tell it that you've finished entering text. Typing Control-D may cause you to log out, so you should try this only as a last resort.

Otherwise, close your Terminal window ( figs/command.gif -W) and open a new one.



Learning Unix for Mac OS X Panther
Learning Unix for Mac OS X Panther
ISBN: 0596006179
EAN: 2147483647
Year: 2003
Pages: 88

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net