Re: Backspace echoed incorrectly with TERM=garbage

2020-06-20 Thread Chet Ramey
On 6/19/20 7:53 PM, Bryan Henderson wrote: > I tracked it down to an Ncurses change. > > Bash/readline attempts to move the cursor left by calling Ncurses (libtinfo) > function 'tputs' with ASCII BS (ctl-H) as the argument. The function of > 'tputs' is to write stuff to the terminal with delays

Re: Backspace echoed incorrectly with TERM=garbage

2020-06-19 Thread Bryan Henderson
I tracked it down to an Ncurses change. Bash/readline attempts to move the cursor left by calling Ncurses (libtinfo) function 'tputs' with ASCII BS (ctl-H) as the argument. The function of 'tputs' is to write stuff to the terminal with delays added, as required by early printing terminals. In

Re: Backspace echoed incorrectly with TERM=garbage

2020-06-18 Thread Andrew Church
>But I thought of 'strace'. I attached that to the Bash process and >clearly saw it sending only space characters, no backspaces: > >pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = 1 (in [0]) >read(0, "q", 1) = 1 >write(2, " ", 1)= 1 I can reproduce

Re: Backspace echoed incorrectly with TERM=garbage

2020-06-18 Thread Bryan Henderson
> Try the xev program. It will show X events and may reveal the keypresses > you're interested in. Thanks. The mystery here is on the other side - things received by the terminal, not keys pressed. But I thought of 'strace'. I attached that to the Bash process and clearly saw it sending only

Re: Backspace echoed incorrectly with TERM=garbage

2020-06-18 Thread Dennis Williamson
On Thu, Jun 18, 2020, 6:03 PM Bryan Henderson wrote: > ... Any ideas on how I could see > the raw character stream sent to a terminal? > > Try the xev program. It will show X events and may reveal the keypresses you're interested in. >

Re: Backspace echoed incorrectly with TERM=garbage

2020-06-18 Thread Bryan Henderson
> When you press Backspace to erase a character, what normally happens is that > three characters are sent to the terminal: backspace, space, and backspace. > ... > Is it possible that your terminal is receiving BS-space-BS and for whatever > reason, is ignoring/discarding the two BS characters,

Re: Backspace echoed incorrectly with TERM=garbage

2020-06-18 Thread Greg Wooledge
On Thu, Jun 18, 2020 at 08:53:57PM +, Bryan Henderson wrote: > I see this with an X.org xterm under Linux and a Linux virtual console, both > through SSH (Openssh), and Putty in Windows, via Putty's SSH. > > To simplify things, I set my erase key to "q" (stty erase q). ctl-V q > confirms

Re: Backspace echoed incorrectly with TERM=garbage

2020-06-18 Thread Bryan Henderson
> I imagine that depends on your terminal and your stty settings. On MacOS with > Bash 5 in Terminal.app what you describe doesn't happen for me. What terminal > are you using? What is the output of stty -a with respect to erase? What do > you get in that setup when you press Ctrl-V then

Re: Backspace echoed incorrectly with TERM=garbage

2020-06-18 Thread Chet Ramey
On 6/17/20 5:30 PM, bry...@giraffe-data.com wrote: > Bash Version: 5.0 > Patch Level: 3 > Release Status: release > > Description: > > With TERM environment variable set to an undefined terminal type, Bash > echoes a backspace as a space; I expect it to echo as a backspace (ctl-h). > It

Re: Backspace echoed incorrectly with TERM=garbage

2020-06-18 Thread Greg Wooledge
Also, of import in any terminal question is the content of your prompt (PS1 variable). See https://mywiki.wooledge.org/BashFAQ/053

Re: Backspace echoed incorrectly with TERM=garbage

2020-06-18 Thread Greg Wooledge
On Wed, Jun 17, 2020 at 09:30:25PM +, bry...@giraffe-data.com wrote: > With TERM environment variable set to an undefined terminal type, Bash > echoes a backspace as a space; I expect it to echo as a backspace (ctl-h). > It edits the line properly; it just isn't displayed correctly. >

Re: Backspace echoed incorrectly with TERM=garbage

2020-06-17 Thread Dennis Williamson
On Wed, Jun 17, 2020, 5:07 PM wrote: > Configuration Information [Automatically generated, do not change]: > Machine: x86_64 > OS: linux-gnu > Compiler: gcc > Compilation CFLAGS: -g -O2 > -fdebug-prefix-map=/build/bash-2bxm7h/bash-5.0=. -fstack-protector-strong > -Wformat -Werror=format-security

Backspace echoed incorrectly with TERM=garbage

2020-06-17 Thread bryanh
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -g -O2 -fdebug-prefix-map=/build/bash-2bxm7h/bash-5.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wno-parentheses -Wno-format-security uname