Bug#948343: closed by Gioele Barabucci (Re: Bug#948343: bash: Cursor lands before the prompt in specific case)

2024-08-23 Thread Julien Palard
Looks like the bug survived in 5.2.21, at least with 5.2.21-2.1+b1 from 
trixie:


bash-5.2$ printf "Hello World\n    "
Hello World
    bash-5.2$ bash --version
GNU bash, version 5.2.21(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 



This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
bash-5.2$

--
[Julien Palard](https://mdk.fr)


Bug#948343: bash: Cursor lands before the prompt in specific case

2020-01-07 Thread Julien Palard
It can also be reproduced using non-space characters, like:

mdk@seraph:~$ printf "Hello World\n01234567890123456789"
Hello World
01234567890123456789mdk@seraph:~$ printf "Hello World\n01234567890123456789"
  ^ The point jumps here (on the 2nd 4)

-- 
Julien Palard
https://mdk.fr



Bug#948343: bash: Cursor lands before the prompt in specific case

2020-01-07 Thread Julien Palard
Forgot to mention: Bug appear, or not, depending on the length of the command.

To be more specific:
- Whith SHORT prompts you have more chance to reproduce the bug
- With LONG commands you have more chance to reproduce the bug

-- 
Julien Palard
https://mdk.fr



Bug#948343: bash: Cursor lands before the prompt in specific case

2020-01-07 Thread Julien Palard
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  libc62.29-3
ii  libtinfo66.1+20191019-1

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

Versions of packages bash suggests:
pn  bash-doc  

-- no debconf information