Problem putty or xterm command line does not return when Ctrl+s is resolved

Source: Internet
Author: User

Friends who often use command lines such as Putty or xterm to control Linux systems may encounter problems like mine: When you press ctrl+s, the command line does not respond at all. Then close the window and reopen it, which is very uncomfortable, and now we're going to solve the problem.

As long as the first editor you use is not vim, or a friend of Emacs, the most frequently used shortcuts in the editing process are probably ctrl+s. And for those who often use putty or xterm to control Linux, Unix systems, I'm afraid I often encounter the same problem, instinctively pressed the ctrl+s, found that the command line is completely unresponsive. Helpless, you can only reopen the window and reopen the new command line interface.

Each time you reopen the command line, you need to first connect to the server, kill the programs that were started, and then execute them again.

In fact, this is because Ctrl+s has started Xoff (Turn off flow control). This will allow the terminal to accept the key operation normally, but will not do any output, feel like the command line does not respond to the same.

This article will provide you with three major solutions:

An immediate solution

A permanent solution

Stone Solutions

  An immediate solution

Direct ctrl+q, open flow Control (XON). If you do some other keystrokes before the ctrl+q operation, you should be able to see the output again at the terminal.

  A permanent solution

You can prevent Ctrl+s commands from sending Xoff directly in. bashrc.

Add the following two lines to your. BASHRC (you can see more options for man Stty):

Stty Ixany

Stty Ixoff-ixon

  Stone Solutions

In fact, we can really let Ctrl+s in vim to save the file:

. Modifications in the BASHRC

Stty Ixany

Stty Ixoff-ixon

Stty Stop undef

Stty start undef

. VIMRC, Ctrl+s Save the current file

Map:w

Imap:wa

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.