romkatv / powerlevel10k

A Zsh theme
MIT License
44.25k stars 2.12k forks source link

[WARNING]: Console output during zsh initialization detected for iconv: iconv_open(, -t): Invalid argument #2683

Closed alexventuraio closed 1 month ago

alexventuraio commented 1 month ago

I started to get this error just today after updating iTerm2 and it asked me to select local:

image

As you can see, I selected English - United States and the I started to get this on every single command I execute and every new tab or window.

image

Is there a correct way to fix it?

iTerm2 Build 3.5.0 Powerlevel10k version: updated with git -C ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k pull

romkatv commented 1 month ago

What happens if you disable powerlevel10k or replace it with another theme?

alexventuraio commented 1 month ago

I set oh-my-zsh to use a different them:

ZSH_THEME="bullet-train"

And it shows this:

image
alexventuraio commented 1 month ago

Seems like this function is causing some troubles https://github.com/romkatv/powerlevel10k/blob/master/gitstatus/src/dir.cc#L157-L174

It seems like if I change my iTerm2 setting from this:

image

To this:

image

The error goes away.

alexventuraio commented 1 month ago

sorry @romkatv, so is this issue something not related to powerlevel10k at all? I mean, not something to take care of and fix?

romkatv commented 1 month ago

You've confirmed that you see the same error without powerlevel10k, right? Powerlevel10k just adds a wall of text above that essentially says that you have an error message (quoted below) that you must do something about.

romkatv commented 1 month ago

See that -- console output produced during zsh initialization follows -- line close to the bottom of the screen on your first screenshot? It separates the wall of text from the actual error. Note that the wall of text includes an option to simply turn off the wall of text. You'll still get the error though, so it's not a real solution. The wall of text says as much, albeit it's not super clear.

alexventuraio commented 1 month ago

Thanks for clarifying @romkatv !

BTW I looked at OhMyZsh repo and the issue is well known and just for future references, the fix is setting the LANG environment variable to something with UTF-8 as stated here.

brianhu-tw commented 3 weeks ago

https://github.com/romkatv/powerlevel10k/issues/2683#issuecomment-2125580559

I experienced the same issue, and it was solved with this solution.