Package: bash
Version: 5.0-5
Severity: normal
Tags: upstream

Dear Maintainer,

With a really specific procedure I'm able to reproduce an issue I'm having 
~weekly:

- Move ~/.bashrc elsewhere just to start clean
- Start a new terminal (in my case tput cols tells it's 79 columns, beware, the 
bug varies according to the terminal width).
- run `bash --norc` in it, to start clean
- Prompt in my case is `bash-5.0$ `, beware, the bug varies according to the 
length of the prompt.
- type `printf "Hello World\n                    "` (1)
- hit the `uparrow` of your keyboard to see the printf again (2)
- hit C-a (bash shortcut for beginning-of-line) (3)

After (1) you should see (I'm using ■ to mark the place of the cursor):

    bash-5.0$ printf "Hello World\n
    Hello World
                        bash-5.0$ ■

After (2) you should see:

    bash-5.0$ printf "Hello World\n                    "
    Hello World
                        bash-5.0$ printf "Hello World\n                    "■

After (3) you should see:

    bash-5.0$ printf "Hello World\n                    "
    Hello World
              ■         bash-5.0$ printf "Hello World\n                    "

The point should not go that far, it should stop on the `p` of `printf`.

I straced and played a bit with, and noted a few interesting things:

- Bug appear, or not, depending on the length of the prompt
- Bug appear, or not, depending on the width of the terminal
- When beginning-of-line calls `write(2, "\r\33[C\33[C\33[C\33[C\33[C...` I 
have the bug
- When beginning-of-line calls `write(2, "\10\10\10\10\10\10\10\10\10...` I 
don't have the bug

-- System Information:
Debian Release: bullseye/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.3.0-3-amd64 (SMP w/16 CPU cores)
Kernel taint flags: TAINT_WARN
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages bash depends on:
ii  base-files   11
ii  debianutils  4.9.1
ii  libc6        2.29-3
ii  libtinfo6    6.1+20191019-1

Versions of packages bash recommends:
ii  bash-completion  1:2.8-6

Versions of packages bash suggests:
pn  bash-doc  <none>

-- no debconf information

Reply via email to