zsh-autocomplete icon indicating copy to clipboard operation
zsh-autocomplete copied to clipboard

On Debian LXC Containers The first characters entered are displayed twice

Open ciddi89 opened this issue 4 months ago • 4 comments

On LXC Containers running Debian there is a curiouse bug. Or maybe I missed a setting? The first two entered characters are displayed twice. On Debian VM and MacOS there is no problem and the plugin is running fine. I'm using it as zsh plugin

My Debian Version: Distributor ID: Debian Description: Debian GNU/Linux 11 (bullseye) Release: 11 Codename: bullseye

Here some screenshots:

Bildschirmfoto 2024-02-19 um 21 19 20 Bildschirmfoto 2024-02-19 um 21 19 31 Bildschirmfoto 2024-02-19 um 21 19 39

ciddi89 avatar Feb 19 '24 20:02 ciddi89

I'm experiencing the same thing in WSL2 on Windows 11 in both Windows Terminal and Alacritty. Also, I'm using starship.rs as my prompt - also happens with default oh-my-zsh prompt.

I found, that if I my prompt character is either a unicode character or a UTF-8 symbol (like an arrow) then the error happens. When my prompt is a simple > character, then the issue no longer appears. Interestingly, I do not experience this error when I start a vterm from emacs.

Therefore I suspect that the issue stems from the character length ambiguity from the terminal emulator, where sometimes it's larger than 1 for unicode - this is likely what is causing a trip-up for this plugin.

I have no idea about how to fix this and am perfectly happy using a simple > as my prompt character.

schwanberger avatar Feb 20 '24 12:02 schwanberger

Hi @schwanberger thanks for your reply, so I'm not alone with this. And yes, you're right, I tested it and with a normal '>' instead of the arrow it works fine. I'm just wondering why it works on some systems and not on others. Maybe something is missing.

ciddi89 avatar Feb 20 '24 17:02 ciddi89

Using the default WSL way to get a shell, it turns out it is not a login shell. I concluded that the issue stems from locale issues - which is stated many times when googling the issue.

This also explains why the issue was not present in emacs (vterm) since a login shell was created there.

Perhaps you (@ciddi89)* could check locale stuff and ensure you have an interactive login shell?

*EDIT: Ping author

schwanberger avatar Mar 10 '24 07:03 schwanberger

hmm okay, I'm not really familiar with it so I had to read what it is first. To my understanding it is an interactive login shell.

echo $0 gives me -zsh so the minus means it's a login shell and echo $- gives me 569JNRXZghiklms and the little i means it's interactive.

So I don't know, maybe I'm wrong and you can help me to find the right way.

ciddi89 avatar Mar 19 '24 11:03 ciddi89