From: Michael Olbrich <m.olbrich@pengutronix.de>
To: ptxdist@pengutronix.de
Subject: Re: [ptxdist] Backspace not working in terminal (using ssh)
Date: Fri, 22 Mar 2019 08:55:39 +0100 [thread overview]
Message-ID: <20190322075539.vz5u6txzjsy7ours@pengutronix.de> (raw)
In-Reply-To: <32790f0b-aad7-1c31-447e-4782b0e90bea@mev.co.uk>
On Thu, Mar 21, 2019 at 03:24:48PM +0000, Ian Abbott wrote:
> On 21/03/2019 13:33, Michael Olbrich wrote:
> > On Thu, Mar 21, 2019 at 12:46:40PM +0000, Ian Abbott wrote:
> > > On 20/03/2019 15:41, Michael Olbrich wrote:
> > > > On Wed, Mar 20, 2019 at 12:41:47PM +0000, Ian Abbott wrote:
> > > > > On 20/03/2019 09:15, Dold, Wolfram wrote:
> > > > > > On Tue, 2019-03-19 at 17:42 +0000, Ian Abbott wrote:
> > > > > > > On 19/03/2019 12:33, Dold, Wolfram wrote:
> > > > > > > > Hi Ian,
> > > > > > > > On Tue, 2019-03-19 at 12:06 +0000, Ian Abbott wrote:
> > > > > > > > > On 19/03/2019 09:17, Dold, Wolfram wrote:
> > > > > > > > > > Hi there,
> > > > > > > > > > when we connect via ssh to our embedded device, the backspace key does not work.
> > > > > > > > > > During the analysis we found out that the passage
> > > > > > > > > >
> > > > > > > > > > # This fixes the backspace when telnetting in.
> > > > > > > > > > if [ "$TERM" != "linux" ]; then
> > > > > > > > > > stty erase ^H
> > > > > > > > > > fi
> > > > > > > > > >
> > > > > > > > > > from the file '/etc/profile' contained in ptxdist.
> > > > > > > > > >
> > > > > > > > > > Now I want to ask, how best to fix this behavior?
> > > > > > > > > > Can the passage simply be omitted? (At least the comment lets me assume that, because there 'telnet' is
> > > > > > > > > > mentioned
> > > > > > > > > > and
> > > > > > > > > > that is no longer necessarily state of the art).
> > > > > > > > > > Or does omitting it lead to other unwanted side effects?
> > > > > > > > > >
> > > > > > > > > > Any help would be appreciated.
> > > [snip because it's getting a bit long]
> > >
> > > > > I've no idea why that bit of the /etc/profile file is there, but I guess it
> > > > > must have suited one of the PTXdist developers at the time. A "git blame"
> > > > > only revealed that the whole file was added in 2006, so I don't know how
> > > > > relevant that part of it is today.
> > > >
> > > > This code was moved around some more. It was actually introduced in the
> > > > initial import from CVS in 2003 :-). Telnet works just fine without this,
> > > > so I guess this is no longer needed.
> > >
> > > Perhaps it was there for the Windows Telnet client which seems to send ASCII
> > > BS when the "Backspace" key is pressed and ASCII DEL when the (less
> > > conveniently placed) "Delete" key is pressed. This mimics the codes sent by
> > > the VT-102 "Backspace" and "Delete" keys which were both conveniently
> > > placed.
> > >
> > > The Windows telnet client has a -t option to set the terminal type to one of
> > > "vt100", "vt52", "ansi", or "vtnt", but it doesn't pass the selected
> > > terminal type to the server, and this doesn't seem to have any effect on the
> > > codes sent by the "Backspace" and "Delete" keys. The TERM environment
> > > variable ends up getting set to "vt102" by default on my PTXdist systems if
> > > a terminal type hasn't been passed through by the Telnet client. I don't
> > > know if that is configurable.
> > >
> > > The Windows Telnet client isn't installed by default, but can still be
> > > installed as a "Windows Feature". I guess most people who used it would
> > > have switched to something like PuTTY by now.
> >
> > I'm pretty sure it was a Linux issue. I remember having problems like this
> > a long time ago.
> >
> > > > I'll be happy to apply a patch that removes this.
> > >
> > > I'm worried that doing so might annoy some people who expect the existing
> > > behavior.
> >
> > I'd rather fix a real problem. If it causes issues, then we'll try to find
> > a solution.
>
> Changing it would probably annoy gtkterm users, and annoy minicom users less
> so. For both of those, the Backspace key sends BS by default. There is an
> option to change it to DEL in minicom, but no such option in gtkterm (or if
> it exists, it is well hidden!). (Personally, I prefer minimalist, dumb
> serial terminal emulators such as picocom, nanocom, and microcom which just
> run inside a local terminal session.)
Ok, I did some testing and now I'm rather confused. I tested minicom,
microcom and gtkterm on the serial port and putty (on Linux) via serial
port and telnet and a normal telnet.
In all cases backspace and delete work as expected with 'stty erase ^H' and
'stty erase ^?'.
Am I missing something here or is something magically doing the right thing
in the background?
Michael
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
next prev parent reply other threads:[~2019-03-22 7:55 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-19 9:17 Dold, Wolfram
2019-03-19 10:31 ` Roland Hieber
2019-03-19 10:57 ` Dold, Wolfram
2019-03-19 12:06 ` Ian Abbott
2019-03-19 12:33 ` Dold, Wolfram
2019-03-19 17:42 ` Ian Abbott
2019-03-20 9:15 ` Dold, Wolfram
2019-03-20 12:41 ` Ian Abbott
2019-03-20 15:41 ` Michael Olbrich
2019-03-21 12:46 ` Ian Abbott
2019-03-21 13:33 ` Michael Olbrich
2019-03-21 14:47 ` Ian Abbott
2019-03-21 15:24 ` Ian Abbott
2019-03-22 7:55 ` Michael Olbrich [this message]
2019-03-22 10:16 ` Ian Abbott
2019-03-22 12:30 ` [ptxdist] [PATCH] projectroot: remove setting stty erase character to "^H" Dold, Wolfram
2019-03-21 10:45 ` [ptxdist] Backspace not working in terminal (using ssh) Dold, Wolfram
2019-03-21 11:26 ` Michael Olbrich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190322075539.vz5u6txzjsy7ours@pengutronix.de \
--to=m.olbrich@pengutronix.de \
--cc=ptxdist@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox