Problem with backspace key when telnet from a linux

249 views
Skip to first unread message

David Gernez

unread,
Jul 12, 2005, 11:46:06 AM7/12/05
to
Hi,

I've a problem with backspace key when I connect with telnet from the
console of a linuxbox to my scobox.
I tried to do a stty erase ^H on the linux box but it is not working. Is
there a way to pass it on the telnet command line ? When I use control + h
key into the console it's working fine but not the backspace key.

Thanks,

David


Bob Bailin

unread,
Jul 12, 2005, 1:02:20 PM7/12/05
to

"David Gernez" <dge...@magelec.com> wrote in message
news:42d3e4c2$0$8238$636a...@news.free.fr...

What emulation are you using? If it's something in the vt100 series, then perhaps
your backspace key is mapped to the delete char instead of backspace (^H).

Bob


Brian K. White

unread,
Jul 12, 2005, 2:32:09 PM7/12/05
to

2 things

1) you need to copy termcap and terminfo terminal description entries from
linux to sco and install them on sco, and probably xterm as well since I'm
guessing that on linux you aren't really working at the text console but in
kde or gnome.

2) you do the stty on the box you are going to, not the one you came from.
You _could_ change the way the linux console behaves to be like sco before
telnetting to the sco box but for many reasons, don't.
On linux your backspace key emits ^? which the sco box sees as the Del key,
which also just happens to be the default break key on sco.
On linux your break key is ^c which has no special meaning to the sco box by
default.
What you do is, after connecting to sco, you use stty to tell sco the sco
box that you want the break key to be ^c and the backspace key to be ^?
because that is what your terminal is actually doing.

I do it by having this in /etc/profile near the end.

case $TERM in
""|unknown|dumb|dial*|tty|*ansi*)
TERM=ansi
;;
linux|xterm|rxvt)
stty intr '^c'
stty erase '^?'
tput smpch
;;
esac
export TERM


Actually I have to add a cons25 stanza to that now since I'm using freebsd
more and more, and despite the notes in freebsd, the cons25 console is not
actually similar enough to the sco console to work by just setting
TERM=ansi. Some progs work, some don't.

Note about "tput smpch":
* Maybe you want it, maybe you don't. It depends on how the linux termcap &
terminfo entries you installed on sco are defined wrt alternate character
sets and graphics characters and other high ascii (above 127) characters.
* It tells the linux console to go into pc character set mode, that is, use
cp437, aka vga, aka ibm characters (instead of the default latin-1).
* It only works because I have installed a linux terminfo entry on sco and
that entry includes the smpch field. The actual escape code it sends is
\E[11m and you could use echo "\033[11m\c" instead.
* A different approach is to send the code that tells the linux terminal to
"just don't do any character set translation at all" which is echo
"\033(U\c", which is the same as doing "mapchan -n" on sco.
* These days you may also need to tell the linux console to drop out of
unicode mode. echo '\033%@\c'


--
Brian K. White -- br...@aljex.com -- http://www.aljex.com/bkw/
+++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
filePro BBx Linux SCO FreeBSD #callahans Satriani Filk!

David Gernez

unread,
Jul 12, 2005, 5:28:07 PM7/12/05
to
Hi Brian,

Thanks for the answer I was thinking it the other way, and .profile
conditions are solving my problems of different terminals connecting. It's
working fine now.

David


Reply all
Reply to author
Forward
0 new messages