Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zsh on Arch container leaves behind characters after exiting completion #507

Closed
sbancuz opened this issue Nov 8, 2022 · 11 comments
Closed
Labels
bug Something isn't working

Comments

@sbancuz
Copy link

sbancuz commented Nov 8, 2022

Hi,
i know this might not be an issue with distrobox itself, but i really don't know where to submit this bug.

I created a new arch container and installed zsh, changed the default shell with sudo chsh $USER -s /bin/zsh and everything works fine (it even picks up my host's zsh configs with oh-my-zsh), but when i try to use autocompletion with tab sometimes it leaves some characters behind that are not part of the "command string buffer".

As you can see the part left behind from completion doesn't create any problems but it's just annoying.
As for the motivation why i submit this bug here and not to Konsole (terminal emulator i'm using) or zsh is because when i use zsh in my host system this doesn't happen.
sample copy pasted from my terminal

➜  ~ LA as ds
Assembler messages:
Error: can't open ds for reading: No such file or directory
➜  ~ is uname            
Linux
➜

The LA and is in the beginning of the command are never registered and as you can see the command after runs fine.

I'm on fedora Kinoite 36, kernel 6.0.5 (but i had this bug even before updating the kernel)
distrobox v1.4.1, podman v4.2.1 and the latest arch image

@sbancuz sbancuz added the bug Something isn't working label Nov 8, 2022
@sbancuz sbancuz changed the title [Error] Zsh on Arch container leaves behind characters after exiting completion Zsh on Arch container leaves behind characters after exiting completion Nov 8, 2022
@89luca89
Copy link
Owner

Hi @sbancuz

can you test with this command?

podman run archlinux:latest bash, then install zsh, load your config, and see if the problem persists?

Thanks

@sbancuz
Copy link
Author

sbancuz commented Nov 24, 2022

I'm probably not understanding something, but that command does literally nothing on my machine.
I tried with a new distrobox and the problem still persists, also tried on my laptop.

my .zshrc it's the standard that comes with oh-my-zsh with these plugins if it helps:
plugins=(git
zsh-completions
zsh-autosuggestions
zsh-syntax-highlighting
)

@89luca89
Copy link
Owner

Hi @sbancuz

sorry I've given you the wrong command, try this: podman run -ti archlinux:latest bash

Then you install zsh and omzsh inside it with your configs, and try if it does the same problem

@sbancuz
Copy link
Author

sbancuz commented Nov 24, 2022

Hi, thanks for the help with podman, never really used it that much.
Installing the configs in the podman container doesn't give any problems, does distrobox enter mess with the shell in any way other than what podman does?

@juhp
Copy link
Contributor

juhp commented Nov 25, 2022

I am wondering if this could be related somehow to #398? But maybe not

@sbancuz
Copy link
Author

sbancuz commented Nov 25, 2022

I think it's the same problem but the solution presented in that thread don't work for me.
I've checked $LANG = en_US.UTF-8, $TERM = xterm-256color and made containers.conf file in my .configs.

@89luca89 should i close this issue and move the discussion to #398?

@89luca89
Copy link
Owner

@sbancuz Not sure if it's the same issue to be honest

So a plain podman container does not present this problem, this indeed is a distrobox issue and I'll need to do an investigation

@sbancuz
Copy link
Author

sbancuz commented Nov 30, 2022

I also managed to connect to my arch container with vs code using the remote containers extension pack, and i don't see the problem.
It still uses podman, but it manages to attach to the running container created by distrobox.

I suspect the bug is in the distrobox-enter script

@89luca89
Copy link
Owner

89luca89 commented Dec 5, 2022

I also managed to connect to my arch container with vs code using the remote containers extension pack, and i don't see the problem. It still uses podman, but it manages to attach to the running container created by distrobox.

I suspect the bug is in the distrobox-enter script

Thanks, I'll try to reproduce this

Can anyone of you folks provide me a specific setup with zsh/omzsh that can reproduce this? Thanks

@sbancuz
Copy link
Author

sbancuz commented Dec 5, 2022

zshrc.txt
I use the default one with these plugins:

  • zsh-completions: git clone https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions
  • zsh-autosuggestions git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
  • zsh-syntax-highlighting git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

Then if you want to try to reproduce the vscode thing using flatpak and podman look here flathub/com.visualstudio.code:55

@vcharraut
Copy link

Hey,

I have the same problems using distrobox.
I run Fedora Silverblue as host and Ubuntu as container. Before distrobox I used toolbox for my containers with zsh too and I never encountered this issue.

This bug appears almost everytime I use Ctrl + R in terminal (to get old commands)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants