Powerlevel10k: Prompt not working via ssh

Created on 5 Aug 2019  路  2Comments  路  Source: romkatv/powerlevel10k

Hi, I'm using powerlevel10k with oh-my-zsh on macOS 10.14.6 (zsh is version 5.7.1 from brew) with the MesloLGS NF font from your dotfiles-repo.
When connecting via ssh the prompt won't be rendered correctly and I get this error: _p9k_get_icon:13: character not in range
screenshot

Most helpful comment

The problem is that the locale in your SSH session isn't using utf-8 encoding. If you try to print a non-ascii character with print '\u2B50' or echo $'\u2B50', you'll get "character not in range" error. It's not affecting just p10k but everything you run in the SSH session. To fix this problem you need to run locale -a, pick a locale that has utf8, utf-8 or UTF8 or UTF-8 in its name, and export LANG from your ~/.zshrc or ~/.zshenv with the value set to the chosen locale.

For example:

echo 'export LANG=C.UTF-8' >>! ~/.zshenv

Or:

echo 'export LANG=en_US.UTF-8' >>! ~/.zshenv

All 2 comments

The problem is that the locale in your SSH session isn't using utf-8 encoding. If you try to print a non-ascii character with print '\u2B50' or echo $'\u2B50', you'll get "character not in range" error. It's not affecting just p10k but everything you run in the SSH session. To fix this problem you need to run locale -a, pick a locale that has utf8, utf-8 or UTF8 or UTF-8 in its name, and export LANG from your ~/.zshrc or ~/.zshenv with the value set to the chosen locale.

For example:

echo 'export LANG=C.UTF-8' >>! ~/.zshenv

Or:

echo 'export LANG=en_US.UTF-8' >>! ~/.zshenv

Thank you very much for your quick and helpful response. I was not aware that my locale settings are not in effect in the SSH session.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

georgijd picture georgijd  路  3Comments

sanathkumarbs picture sanathkumarbs  路  3Comments

kensang248 picture kensang248  路  4Comments

rpathak38 picture rpathak38  路  4Comments

fedemengo picture fedemengo  路  7Comments