Score:0

How to translate Backspace(0x08, ^H) to stty erase ^?

ht flag
joe

I am a newby in Linux. I noticed that the default setting of erase is ^? in Centos.

stty -a -> erase=^?

When I press Backspace the input character is ^H. How can Backspace trigger erase and delete a character in this case? Which driver translated ^H -> ^? ?

Score:1
vn flag

Those are actually quite different commands. ^H has been defined as backspace forever, but there is no definition for erase which deletes the entire current text string. So the operation of backspace is defined by standard, as are tab ^I, newline ^J, and carriage return / enter ^M, none of which appear in the returned options from stty.

joe avatar
ht flag
joe
as per `stty -a` `erase` was defined as `^?`. The control code of `Backspace` is `^H`. Why and how can `Backspace` trigger the `erase`?
tsc_chazz avatar
vn flag
Backspace does not trigger `erase`. Backspace, `^H`, triggers `delete character left of cursor`. `^?` triggers `erase`, which is `delete all entered characters`. I don't know if you can redefine `^H` to trigger `erase`, but I also can't see why you'd want to.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.