Re: Buffer corruption when the terminal is resized.
From:
George
Subject:
Re: Buffer corruption when the terminal is resized.
Date:
Sat, 10 Jun 2017 12:47:21 -0400
On Sat, 2017-06-10 at 11:20 -0500, Eduardo Bustamante wrote:
> On Sat, Jun 10, 2017 at 04:56:35PM +0200, Paul Peet wrote:
> >
> > I would like to report a bug with bash (readline?). This bug can be
> > reproduced by opening gnome-terminal with bash running. By quickly
> > horizontally resizing the terminal window you can see that the buffer
> > seems to be corrupted as you see repeated or even removed lines or
> > characters.
> What's the value of your PS1? (use: declare -p PS1)
>
It's actually shown in his video link... Looks like at the start of PS1 he has
\[ and \] surrounding escape characters rather than the whole escape
sequence:
\[\e\]0;
Rather than:
\[\e0;\]
Bash relies on \[ and \] to determine how much space is occupied by the prompt
when it is to be redrawn, so in this case it thinks the prompt is 2
columns wider than it actually is.