LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   backspace makes a ^H character (https://www.linuxquestions.org/questions/linux-newbie-8/backspace-makes-a-%5Eh-character-4175671214/)

erik2282 03-21-2020 06:28 AM

Code:

erik@topaz:~$ stty -a
speed 38400 baud; rows 20; columns 52; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U;
eof = ^D; eol = <undef>; eol2 = <undef>;
swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z;
rprnt = ^R; werase = ^W; lnext = ^V; discard = ^O;
min = 1; time = 0;
-parenb -parodd -cmspar cs8 -hupcl -cstopb cread
-clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlc
r
-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 -flusho
-extproc
erik@topaz:~$ ssh tethra                                            erik@tethra's password:

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Fri Mar 20 18:09:06 2020 from topaz.aasteel.net
erik@tethra:~$ stty -a
speed 38400 baud; rows 4; columns 99; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>;
swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O;
min = 1; time = 0;
-parenb -parodd -cmspar 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
erik@tethra:~$


rtmistler 03-21-2020 09:37 AM

So I know there's a lot of data there and I've found that while each side usually reports things in a similar arrangement, because one has certain things and does not have other things, the sequencing all does appear mixed up between A and B.

I'd check the most likely differences that seem to be related to terminal behavior, and that's unfortunately a lot of them.

Many years ago I had some behavior that wasn't working for me uniformly, these stty settings, if you can guess, also apply to serial terminals and USB serial terminals. I actually had a program which glitched on certain data and my solution was finally to use what they call -raw mode. That is an actual mode for stty, or actually termios(3) which is what all this is related to. That's the programming side of things just so you know.

In the end, I was attaching and trying different settings +parenb -parenb, you can set those on or off using + or -. And I found a few key things which affected the behaviors related to my specific problem.

The other thing is I fully trust those outputs you have, never paid enough attention, but notice how it says "erase = ^?", there? I'd give CTRL-? a try just for a test.

Sorry, I know there's no easy answers here, I'd actually start with setting it to +raw mode and see how it behaves.

pan64 03-21-2020 03:07 PM

for gnome terminal there is a setting: backspace generates ^H, DEL or something else. Probably you need to configure your terminal emulator software to handle the keypress correctly. Probably you need to configure the virtual terminal to catch what was sent by the emulator and act on that event (this is the stty command).


All times are GMT -5. The time now is 12:19 AM.