reporting a bug: output of a long line, longer than fits on winow-size, breakes bash

2022-07-10 Thread Anton Wessel
I am working with Kubuntu 22.04 and KNOPPIX 9.1, bash version is reported 
by KNOPPIX:


5.1.4(1)-release (i686-pc-linux-gnu)


My bash script contains many bash one-liners and comments.

The one-liners are put into the history list by code like:

history -s ': # '

After this script had been run once, I can scroll back in the lines of 
history list.

I can stop scrolling when found a line, e.g.:

: # ps -Flwwc --sort=start_time -t $(tty)

Then I can remove the four characters at beginning of the line:

": # "

and can execute this command.


So far ok.


When a one-liner is long, longer than fits on current window size, then 
problems in bash occure.


This has nothing to do with what is the contents of the long line.

Bash is broken by the fact that window size is exceeded.

I can come to the end of the long line, but I cannot come to the beginning 
of the line.


The scrolling on the screen, in German "Verlauf", by CTRL-SHIFT-F does not 
work any more.


The movement of the cursor by the arrow keys is in the upper part of the 
window confused.


Regards

anton_wes...@t-online.de



Re: reporting a bug: output of a long line, longer than fits on winow-size, breakes bash

2022-07-10 Thread Greg Wooledge
On Sun, Jul 10, 2022 at 02:35:40PM +0200, Anton Wessel wrote:
> When a one-liner is long, longer than fits on current window size, then
> problems in bash occure.
> 
> This has nothing to do with what is the contents of the long line.
> 
> Bash is broken by the fact that window size is exceeded.
> 
> I can come to the end of the long line, but I cannot come to the beginning
> of the line.
> 
> The scrolling on the screen, in German "Verlauf", by CTRL-SHIFT-F does not
> work any more.
> 
> The movement of the cursor by the arrow keys is in the upper part of the
> window confused.

Sounds very much like you've added terminal escape sequences to your
shell prompt, without enclosing them in \[ \] characters.  See
 and check the content of
your PS1 variable (declare -p PS1).