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 was making some changes to a remote file in vi using the terminal when I accidently pressed Ctrl+S instead of :wq.

Now everything got hanged. I tried Escape,:q! and all sorts of vi commans but nothing is responding. The Terminal Screen is stuck. I can't close the Terminal session as of now as it will lead to loss of all the changes. Please suggest what should be done

share|improve this question

2 Answers 2

up vote 8 down vote accepted

Ctrl+Q will undo Ctrl+S. These are ancient control codes to stop and resume output to a terminal. They can still be useful, for instance when you are tailf-ing a log file and something interesting scrolls by, but this era of unlimited scrollback buffers has really obsoleted them.

share|improve this answer

I would like to complement zwets' accepted answer.

You can see the meaning of special keypresses by issuing the commands stty -a and man stty.

stty -a prints all current settings of the terminal. The result in my terminal:

speed 38400 baud; rows 33; columns 80; line = 0;

intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = M-^?; eol2 = M-^?; swtch = M-^?; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;

-parenb -parodd cs8 hupcl -cstopb cread -clocal -crtscts -ignbrk brkint -ignpar -parmrk > -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc ixany imaxbel iutf8

opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke

man stty prints the manual of stty. The part that is relevant here:

Special characters:

   start CHAR
          CHAR will restart the output after stopping it

   stop CHAR
          CHAR will stop the output
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.