zsh-workers
 help / color / mirror / code / Atom feed
* Right-arrow character and autocomplete
@ 2021-10-11 12:04 Darío Cuevas
  2021-10-11 12:14 ` Roman Perepelitsa
  0 siblings, 1 reply; 4+ messages in thread
From: Darío Cuevas @ 2021-10-11 12:04 UTC (permalink / raw)
  To: zsh-workers

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Right-arrow character and autocomplete
  2021-10-11 12:04 Right-arrow character and autocomplete Darío Cuevas
@ 2021-10-11 12:14 ` Roman Perepelitsa
  2021-10-11 16:40   ` Bart Schaefer
       [not found]   ` <CAAA5jK29fniAzbjoJMwX2ikG9ugwbt9p50B4eQKG3oXWKdAd+w@mail.gmail.com>
  0 siblings, 2 replies; 4+ messages in thread
From: Roman Perepelitsa @ 2021-10-11 12:14 UTC (permalink / raw)
  To: Darío Cuevas; +Cc: zsh-workers

[-- 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 --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Right-arrow character and autocomplete
  2021-10-11 12:14 ` Roman Perepelitsa
@ 2021-10-11 16:40   ` Bart Schaefer
       [not found]   ` <CAAA5jK29fniAzbjoJMwX2ikG9ugwbt9p50B4eQKG3oXWKdAd+w@mail.gmail.com>
  1 sibling, 0 replies; 4+ messages in thread
From: Bart Schaefer @ 2021-10-11 16:40 UTC (permalink / raw)
  To: Roman Perepelitsa; +Cc: Darío Cuevas, Zsh hackers list

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.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Right-arrow character and autocomplete
       [not found]   ` <CAAA5jK29fniAzbjoJMwX2ikG9ugwbt9p50B4eQKG3oXWKdAd+w@mail.gmail.com>
@ 2021-10-11 17:01     ` Darío Cuevas
  0 siblings, 0 replies; 4+ messages in thread
From: Darío Cuevas @ 2021-10-11 17:01 UTC (permalink / raw)
  To: zsh-workers

[-- 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 --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-10-11 17:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-11 12:04 Right-arrow character and autocomplete Darío Cuevas
2021-10-11 12:14 ` Roman Perepelitsa
2021-10-11 16:40   ` Bart Schaefer
     [not found]   ` <CAAA5jK29fniAzbjoJMwX2ikG9ugwbt9p50B4eQKG3oXWKdAd+w@mail.gmail.com>
2021-10-11 17:01     ` Darío Cuevas

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).