ohmyzsh / ohmyzsh

🙃 A delightful community-driven (with 2,400+ contributors) framework for managing your zsh configuration. Includes 300+ optional plugins (rails, git, macOS, hub, docker, homebrew, node, php, python, etc), 140+ themes to spice up your morning, and an auto-update tool that makes it easy to keep up with the latest updates from the community.
https://ohmyz.sh
MIT License
172.44k stars 25.81k forks source link

Displayed history of commands causing the terminal to rewrite and breakup the existing typed text, malforming the printed output #12645

Closed 0x0OZ closed 1 week ago

0x0OZ commented 1 week ago

Describe the bug

Text can't truly explain the issue, image Now this is normal command history preview when using zsh, now if I try to keep tying and for example type localhost, the interpreter will be malformed, and even that I added space ( and didn't remove it) it will be removed in the screen image This look so wrong but it actually correct in the terminal and will be a successful command image

It's not terminal issue but rather it's zsh or related to the theme/plugins because I tested it with windows terminal through (ssh)

Steps to reproduce

  1. have a very large last history of some command (like multiple lines)
  2. try to type something else that starts with that command
  3. observe how the text is malformed

Expected behavior

Typed text shouldn't be malformed

Screenshots and recordings

No response

OS / Linux distribution

Linux kali 6.8.11-amd64 #1 SMP PREEMPT_DYNAMIC Kali 6.8.11-1kali2 (2024-05-30) x86_64 GNU/Linux

Zsh version

5.9

Terminal emulator

xfce4-terminal, and windows terminal

If using WSL on Windows, which version of WSL

None

Additional context

My plugins: image And ZSH_THEME="awesomepanda"

mcornella commented 1 week ago

Check that you're using a UTF-8 locale, see https://github.com/ohmyzsh/ohmyzsh/wiki/FAQ#i-see-duplicate-typed-characters-after-i-complete-a-command.

0x0OZ commented 1 week ago

Check that you're using a UTF-8 locale, see https://github.com/ohmyzsh/ohmyzsh/wiki/FAQ#i-see-duplicate-typed-characters-after-i-complete-a-command.

Like this? image That's what I currently have

Harshchauhan64 commented 1 week ago

I have similar kind of issue: image I have tried to change the locale but didnt worked.

0x0OZ commented 1 week ago

It seems this issue is specific to awesomepanda theme

image It gone when switched to different theme

@Harshchauhan64 If you change the theme to something else I assume it should be fixed @mcornella I think this theme is part of this repo, can you test again now but with this specific theme?

Harshchauhan64 commented 1 week ago

I have changed to powerlevel10k but the issue still persist. I was previously on default theme (robyrussell) image In the img the echo cmd is repeated again and my locale are all set correctly. image Honestly I don't know what is making to re prompt the cmd and the issue is not there when running tmux session.

mcornella commented 1 week ago

@0x0OZ make sure that the locale used is exactly as written in the output of locale -a.

@Harshchauhan64 your issue is different. See the resolution of #12332.

mcornella commented 1 week ago

@0x0OZ OK no, this is caused by commit https://github.com/ohmyzsh/ohmyzsh/commit/80c114cb3a64044ea50b623f96a35bc022db5e8d from #5982.

Those added markers makes zsh not know how many characters are inside.

@carlosala can you check this out?

0x0OZ commented 1 week ago

Great, Glad to hear that the root cause is found

mcornella commented 1 week ago

Can you try #12651 to see if it works for you? You can do that with omz pr test 12651. If it doesn't, make sure that the locale set uses the exact UTF-8 one from locale -a.

0x0OZ commented 1 week ago

omz pr test 12651

That does fix it! Thank you :)