Linux Terminal backspace cannot delete characters

Source: Internet
Author: User

Http://blog.chinaunix.net/uid-2282111-id-2113293.html

In the Linux/unix platform often use scanf from the keyboard to get characters, output characters after pressing backspace key to delete, will appear ^h, which is accustomed to the deletion by the BACKSPACE key users, feel very awkward, although you can by CTRL + Backspace key combination for delete function

The terminal configuration can be modified by the Stty command to implement the BACKSPACE removal function. As follows:

QUOTE:

[[email protected] ~]$ ID

uid=501 (Oracle) gid=501 (oinstall) groups=501 (Oinstall), 502 (DBA), 503 (asadmin)

[Email protected] ~]$ Stty erase ^h

To restore the Ctrl+backspace Combo key removal feature, execute the following command:

QUOTE:

[[email protected] ~]$ ID

uid=501 (Oracle) gid=501 (oinstall) groups=501 (Oinstall), 502 (DBA), 503 (asadmin)

[Email protected] ~]$ Stty erase ^?

All terminal settings can also be viewed via stty-a:

QUOTE:

oracle| | oralinux| | /home/oracle| | -->>id
uid=500 (Oracle) gid=501 (oinstall) groups=500 (DBA), 501 (oinstall)
oracle| | oralinux| | /home/oracle| | -->>stty-a
Speed 38400 baud; Rows 24; Columns 80; line = 0;
Intr = ^c; Quit = ^\; erase = ^h; Kill = ^u; EOF = ^d; EOL = <undef>;
Eol2 = <undef>; 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
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

Linux Terminal backspace cannot delete characters

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.