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

Corrupted prompt in ZSH on triggering completion #5798

Closed
jeka opened this issue Feb 25, 2024 · 5 comments
Closed

Corrupted prompt in ZSH on triggering completion #5798

jeka opened this issue Feb 25, 2024 · 5 comments
Labels
🐛 bug Something isn't working as expected.

Comments

@jeka
Copy link

jeka commented Feb 25, 2024

Current Behavior

Initializing starship for ZSH is corrupting the prompt on completion

For example:
empty .zshrc and no custom starship configuration
type cd and hit

without starship loaded:
image

with starship loaded:
image

Expected Behavior

Additional context/Screenshots

Possible Solution

Environment

  • Starship version: 1.17.1
  • version:
  • Operating system: Linux 22.04
  • Terminal emulator:
  • Git Commit Hash:
  • Branch/Tag: master
  • Rust Version: rustc 1.75.0 (82e1608df 2023-12-21)
  • Rust channel: release
  • Build Time: 2024-01-02 18:32:13 +00:00

Relevant Shell Configuration

none/empty .zshrc

Starship Configuration

no custom config
@jeka jeka added the 🐛 bug Something isn't working as expected. label Feb 25, 2024
@jeka
Copy link
Author

jeka commented Feb 26, 2024

Since nowadays it's quite easy to do checks across Linux distributions I spent some time on that.
All the checks are done with distrobox:

  • spawn new container with empty user home dir.
  • install zsh
  • install starship
  • activate starship
    The result:
    Ubuntu 22.04 - exhibits the problem described above
    Ubuntu 23.10 - exhibits the problem described above
    RHEL 9 - broken (actually its broken in the same way even before activating starship)
    Fedora 38 - exhibits the problem described above
    Fedora 39 - exhibits the problem described above
    OpenSUSE Leap - exhibits the problem described above
    I stopped here.

Also, I checked starship versions back to version v1.16.0 with the same outcome.
I hope this helps.

@jeka
Copy link
Author

jeka commented Feb 26, 2024

Further info,
I tacked it down to a problem with the 'character' prompt plugin/module(?).
It's broken if UTF-8 character is used as $symbol.
If I replace the fancy '❯' with ASCII '>' the problem goes away.

Strangely enough, it's broken only under ZSH, I tried BASH and FISH and the problem does not show under these shells.

@jeka
Copy link
Author

jeka commented Feb 26, 2024

Sorry for the noise.

The problem was with my local config.
My locale (LC_xxx) variables got messed up at some point of time (set to non-UTF locale).

Setting them properly fixed the problem.

@jeka jeka closed this as completed Feb 26, 2024
@theSprog
Copy link

Sorry to bother you, I also encountered the same problem. I tried setting LC_XXX, but it didn't seem to work. May I ask how you solved it?

I am using wsl 2.1.3.0 , zsh 5.9 (x86_64-pc-linux-gnu), and startship 1.18.2
this is my locale

❯ cat /etc/default/locale
LC_CTYPE=en_US.UTF-8
LC_ALL=en_US.UTF-8
LANG=en_US.UTF-8

@jeka
Copy link
Author

jeka commented Apr 22, 2024

For me fixing the locale settings did the job.
Maybe it's worth checking what the actual locale settings are with locale

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

No branches or pull requests

2 participants