Re: Weird command line editing issues with Bash

Steve Wechsler <[email protected]> Thu, 9 Nov 2023 16:14:38 -0500
Newsgroups gmane.comp.gnu.screen.user
Message-ID <CAAKkq=FOD8NBN3TkJp6WUEef3MSf-9fFDHmQjER9cVQvH1nHFQ@mail.gmail.com>
--000000000000ba60380609beb12c
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

\033]0;${STY##*.}\007\[\e[00;32m\][${STY##*.}|\u@<hostname> \W]\[\e[00m\]$

On Thu, Nov 9, 2023 at 4:13=E2=80=AFPM Marcin Cieslak <[email protected]> wr=
ote:

> On Thu, 9 Nov 2023, Steve Wechsler wrote:
>
> > Frequently I get odd results when using Emacs mode command line editing
> > in Bash.
> >
> > 1) Sometimes after scrolling back in my history, the first 9 characters
> of
> > the line will remain in place, and the beginning-of-line position moves=
 9
> > characters to the right. So, for example, if I scrolled past an entry
> that
> > started with "awk '{if ($1 > 100 ) {print $2}', when pressing Ctrl-U, t=
he
> > cursor will be positioned after 'awk '{if '. It only seems to be affect=
ed
> > by certain longer entries in the history.
> > 2) When typing a line that's longer than my terminal is wide (including
> the
> > command prompt), the cursor will return to the beginning of the line, b=
ut
> > it will not line feed, so it starts overwriting the text that is alread=
y
> > there. If I make my terminal wider and press Ctrl-L, the line can be
> edited
> > normally, until it needs to wrap again, then the problem repeats.
> >
> > Once I exit screen, command line editing in Bash works properly. The
> Emacs
> > editor itself seems to have no issues, nor does vim.
> >
> > I'm using PuTTy on Windows. $TERM is 'xterm'. I've tried substituting
> > 'vt100' but it didn't fix the problem. Screen  v4.09.00 on Centos7, Bas=
h
> > version is 4.2.46(2).
>
> What is your $PS1 ?

--000000000000ba60380609beb12c
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">\033]0;${STY##*.}\007\[\e[00;32m\][${STY##*.}|\u@&lt;hostn=
ame&gt; \W]\[\e[00m\]$<br></div><br><div class=3D"gmail_quote"><div dir=3D"=
ltr" class=3D"gmail_attr">On Thu, Nov 9, 2023 at 4:13=E2=80=AFPM Marcin Cie=
slak &lt;<a href=3D"mailto:[email protected]">[email protected]</a>&gt; wrote=
:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.=
8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Thu, 9 Nov =
2023, Steve Wechsler wrote:<br>
<br>
&gt; Frequently I get odd results when using Emacs mode command line editin=
g<br>
&gt; in Bash.<br>
&gt;<br>
&gt; 1) Sometimes after scrolling back in my history, the first 9 character=
s of<br>
&gt; the line will remain in place, and the beginning-of-line position move=
s 9<br>
&gt; characters to the right. So, for example, if I scrolled past an entry =
that<br>
&gt; started with &quot;awk &#39;{if ($1 &gt; 100 ) {print $2}&#39;, when p=
ressing Ctrl-U, the<br>
&gt; cursor will be positioned after &#39;awk &#39;{if &#39;. It only seems=
 to be affected<br>
&gt; by certain longer entries in the history.<br>
&gt; 2) When typing a line that&#39;s longer than my terminal is wide (incl=
uding the<br>
&gt; command prompt), the cursor will return to the beginning of the line, =
but<br>
&gt; it will not line feed, so it starts overwriting the text that is alrea=
dy<br>
&gt; there. If I make my terminal wider and press Ctrl-L, the line can be e=
dited<br>
&gt; normally, until it needs to wrap again, then the problem repeats.<br>
&gt;<br>
&gt; Once I exit screen, command line editing in Bash works properly. The E=
macs<br>
&gt; editor itself seems to have no issues, nor does vim.<br>
&gt;<br>
&gt; I&#39;m using PuTTy on Windows. $TERM is &#39;xterm&#39;. I&#39;ve tri=
ed substituting<br>
&gt; &#39;vt100&#39; but it didn&#39;t fix the problem. Screen=C2=A0 v4.09.=
00 on Centos7, Bash<br>
&gt; version is 4.2.46(2).<br>
<br>
What is your $PS1 ?</blockquote></div>

--000000000000ba60380609beb12c--