From: "Dold, Wolfram" <Wolfram.Dold@allegion.com>
To: "ptxdist@pengutronix.de" <ptxdist@pengutronix.de>,
"abbotti@mev.co.uk" <abbotti@mev.co.uk>
Cc: "Dold, Wolfram" <Wolfram.Dold@allegion.com>
Subject: Re: [ptxdist] Backspace not working in terminal (using ssh)
Date: Wed, 20 Mar 2019 09:15:17 +0000 [thread overview]
Message-ID: <669aabd25e3225597a2e7a8cc7b5b12925faec5b.camel@allegion.com> (raw)
In-Reply-To: <b00c0375-889b-863d-1e81-7a0d19ae8c48@mev.co.uk>
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.
> > > >
> > >
> > > Code can interpret input characters in various ways independently of the
> > > stty settings. For example, if the "Command Line Editing" feature is
> > > enabled in the Busybox configuration, the Busybox "ash" and "hush"
> > > shells' interactive line editing will handle both ASCII DEL and ASCII BS
> > > as a "backspace" operation. This can be enabled in the PTXdist
> > > menuconfig via:
> > >
> > > Shell & Console Tools --->
> > > -*- busybox --->
> > > Settings --->
> > > [*] Command Line Editing
> > >
> > > This sets "PTXCONF_BUSYBOX_FEATURE_EDITING=y" in the ptxconfig file.
> > >
> >
> > The feature is already enabled.
> > But it does not work for me. It only works when I delete the stty command from /etc/profile,
> >
> > > If you are using Bash or some other other program with READLINE support,
> > > I think it handles ASCII BS and ASCII DEL similarly to Busybox's command
> > > line editing feature.
> >
> > We do not use bash, we use the busybox shell.
>
> Just for comparison, I'm using the busybox "ash" shell. (There are two
> shells in Busybox - "ash" and "hush".)
>
> My SSH client is set to send ASCII DEL when the backspace is pressed,
> and sets TERM="xterm" or TERM="xterm-256color". The stty command on my
> target system shows "erase ^H".
>
> Both the backspace key (which sends ASCII DEL) and the CTRL-H sequence
> (which sends ASCII BS) result in a backspace operation on the ash
> command line.
>
> If I run a command that doesn't do any fancy line editing, such as:
>
> od -c
>
> then the ASCII DEL characters get passed through to standard input and
> the ASCII BS characters erase the previous characters (as per the stty
> erase ^H setting).
>
> If I change the stty setting:
>
> stty erase '^?'
>
> then both ASCII DEL and ASCII BS result in a backspace operation on the
> ash command line, but for commands that do not do any fancy line
> editing, the ASCII BS is passed through to standard input and the ASCII
> DEL erases the previous character as per the stty erase '^?' setting.
>
> So in summary, the PTXCONF_BUSYBOX_FEATURE_EDITING option seems to work
> for me, at least in the "ash" shell. (I haven't tried the "hush" shell.)
>
> I am using BusyBox 1.29.3 from PTXdist 2019.03.0.
>
Sorry, I didn't describe the problem detailed enough:
When I type in the shell, everything works as you described it.
The problem that the backspace key doesn't work occurs when we
use the busybox-read function from a shell script.
We are using ash from busybox.
We are using BusyBox v1.29.3 from ptxdist 2019.03.1
Sorry again for the miscommunication.
--
Regards, Wolfram
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
next prev parent reply other threads:[~2019-03-20 9:15 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 [this message]
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
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=669aabd25e3225597a2e7a8cc7b5b12925faec5b.camel@allegion.com \
--to=wolfram.dold@allegion.com \
--cc=abbotti@mev.co.uk \
--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