Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm using Ubuntu in command line mode, no GUI. I'm new to UNIX, so I'm a bit confused by something that just happened. I accidentally typed "suspend" instead of "pm-suspend", and my root~#: prompt disappeared. Now, whatever I try to enter just gives me a line break, and pressing keys like esc, gives me ^[, the arrow keys are all something along the lines of ^[^[[D. What can I do to return to the normal shell prompt?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

suspend is a bash built-in command, what it does as per the man page is:

 suspend [-f]
          Suspend  the execution of this shell until it receives a SIGCONT
          signal.  A login shell cannot be suspended; the -f option can be
          used to override this and force the suspension.  The return sta‐
          tus is 0 unless the shell is a login shell and -f  is  not  sup‐
          plied, or if job control is not enabled.

Thus your shell is suspended and will be until you send it a SIGCONT signal. The behavior you see is because the shell is not interpreting those characters.

To fix this:

  1. Go to another virtual console (press alt-F3 or something) and log in.
  2. use pkill to send the CONT signal to all processes named bash. This won't affect other running shells but should "unstick" the stuck one.

    pkill -CONT bash

share|improve this answer
    
Alt-f3 does nothing. Any other way to log into a different virtual console? –  Jules Mazur Jun 3 '12 at 17:19
    
(1) Try the other Alt key on your keyboard, and make sure you hthat would keep an Alt key from behaving like Alt. (2) You can try Ctrl+Alt+F3. (3) You can try a function key besides F3, from F1 to F6 (one of them is the shell you're in...if it's F3, that would explain your problem). (4) This shouldn't be happening if you didn't give the -f flag, unless you started this shell from something that is not a shell. Try Ctrl+C and (if that doesn't help) Ctrl+D. –  Eliah Kagan Jun 3 '12 at 17:24
    
None of that works –  Jules Mazur Jun 3 '12 at 17:46
    
If you know your system's IP address and installed openssh-server, you can ssh into it and do this. Otherwise, if you're unable to switch to another console, it may be running in single-user mode, in this case, you can simply reboot the system to regain control. –  roadmr Jun 3 '12 at 18:27
    
@Verandaguy it's <ctrl>+<alt>+<F3>. –  hexafraction Jul 2 '12 at 20:01
add comment

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.