Greetings, perhaps this has been reported before (many times?), but here it goes. If there is an arrow character in the prompt, hitting TAB to autocomplete will always duplicate the command written so far. I've had this problem for a couple months already (presumably after an zsh update), on both kubuntu 20.04 and manjaro(KDE). To reproduce, one needs only do PROMPT="→" on .zshrc, open a terminal, start typing some command (e.g. ls) and hit TAB: the command (ls) will be written twice. Happens every time. If you need any more information, I'm happy to help. Best, Darío Cuevas
[-- Attachment #1: Type: text/plain, Size: 628 bytes --] On Mon, 11 Oct 2021 at 14:05, Darío Cuevas <superdarion@gmail.com> wrote: > To reproduce, one > needs only do PROMPT="→" on .zshrc, open a terminal, start typing some > command (e.g. ls) and hit TAB: the command (ls) will be written twice. This usually happens when you put non-ascii characters in PROMPT (like that arrow) but your locale is not UTF-8. Run `locale` to confirm. To fix this, install and enable a UTF-8 locale. This can also happen when TERM environment variable doesn't match the real terminal type. To fix this you need to avoid overwriting the value of TERM set by the terminal. Roman. [-- Attachment #2: Type: text/html, Size: 1059 bytes --]
On Mon, Oct 11, 2021 at 5:15 AM Roman Perepelitsa
<roman.perepelitsa@gmail.com> wrote:
>
> On Mon, 11 Oct 2021 at 14:05, Darío Cuevas <superdarion@gmail.com> wrote:
>>
>> To reproduce, one
>> needs only do PROMPT="→" on .zshrc, open a terminal, start typing some
>> command (e.g. ls) and hit TAB: the command (ls) will be written twice.
>
> This usually happens when you put non-ascii characters in PROMPT (like that arrow) but your locale is not UTF-8. Run `locale` to confirm. To fix this, install and enable a UTF-8 locale.
Although that's the best solution, if for some reason that can't be
done you can try using the "glitch" prompt escape to tell zsh what the
actual character width is.
PROMPT="%1{→%}"
tells zsh that although there are 3 bytes in the %{...%} sequence, it
should be treated as occupying only one character position.
[-- Attachment #1: Type: text/plain, Size: 1500 bytes --] Apologies, seems I forgot to reply to all. See my message below. Tl:dr: my OS had indeed a locale problem which I now corrected. Now it all works well. Thanks for your help and sorry for the false report. On Mon, Oct 11, 2021, 15:14 Darío Cuevas <superdarion@gmail.com> wrote: > That was a quick reply. > > I checked and my locale was wrong (some values were set to "C", > instead of the de_DE.UTF-8 of the rest), caused by some bad KDE plasma > configuration file. It actually helped me solve an unrelated problem > I've had for a while, so thanks a lot! > > Sorry to have reported it as a bug when it was my system's fault. > > Best regards, > Darío > > > El lun, 11 oct 2021 a las 14:14, Roman Perepelitsa > (<roman.perepelitsa@gmail.com>) escribió: > > > > On Mon, 11 Oct 2021 at 14:05, Darío Cuevas <superdarion@gmail.com> > wrote: > >> > >> To reproduce, one > >> needs only do PROMPT="→" on .zshrc, open a terminal, start typing some > >> command (e.g. ls) and hit TAB: the command (ls) will be written twice. > > > > > > This usually happens when you put non-ascii characters in PROMPT (like > that arrow) but your locale is not UTF-8. Run `locale` to confirm. To fix > this, install and enable a UTF-8 locale. > > > > This can also happen when TERM environment variable doesn't match the > real terminal type. To fix this you need to avoid overwriting the value of > TERM set by the terminal. > > > > Roman. > > > > -- > Yes, indeed. > [-- Attachment #2: Type: text/html, Size: 2139 bytes --]