I am surprised that backspace characters are not actually meant to erase characters in normal Linux terminals, when printed (which Usually works while typing). .
This works as expected:
$ echo -e "abc \ b \ b \ bxyz" xyz
^ h
( 0x08
) provided)
But when the backspace is low after Strange behavior occurs:
$ echo -e "abc \ b \ b \ bx" Xbc
Code> $ echo-A "A Dc E [D \ e [DX "xbc
Erase line works normally:
$ In fact, when I Ctrl + V type backspace
/ kbd> In the terminal, (My environment is xterm linux and some other), but this is another story ... Terminal emulator, ^? Is generated in place of
( 0x7f
) ^ h
, it is del ascii character, but Ctrl + v del product & lt; ESC & gt; [3]
$ TERM
= = xterm
, tried vt100
, Linux
)
What you see is correct. Backspace or ^ H
moves the cursor to the left, to erase one character, you will see the output ^ H ^ h
(backspace-space-backspace) ) is required.
To answer your comment - Backspace has been defined VT100 / ANSI family of Terminal, many of which borrow terminal code, see the VT100 user manual which can be used for BS Moves the function "to the cursor on the left side of one place, unless it is on the left margin, in which case there is no action". In other words, it is the sound of history :)
It was initially defined in this way - I think this destructive cursor movement is more flexible for the control code because the devastating backspace is enforced It can be done as shown above.
Comments
Post a Comment