1

Trying to get powerline/airline symbols to show in vim running in a Debian container created with sudo systemd-nspawn -D ~/debian-tree/ on a Fedora host.

Right now it just shows question marks in diamonds (��) I'm pretty sure I need to set the locale but I can't find a straight forward answer on how to do this properly.

Output of locale

LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

output of locale -a

C
C.UTF-8
POSIX
1

Setting the locale is documented in the Debian install guide - there's an appendix which provides some hints on installing directly with debootstrap and configuring the system yourself.

To configure your locale settings to use a language other than English, install the locales support package and configure it. Currently the use of UTF-8 locales is recommended.

# aptitude install locales
# dpkg-reconfigure locales

The appendix as a whole has a disclaimer that it is not comprehensive, but it is official documentation and this specific method is perfectly correct. There are other alternatives which may be preferred for scripting - this method prompts the user to choose which locale(s).

There is a second issue which the appendix also mentions in passing. I am not sure if it affects your specific character issue, but it can cause issues with similar sophisticated output. You need to make sure that TERM is set correctly. Run echo $TERM outside the container. Inside the container, run e.g. export TERM=xterm-256color to set the terminal type for this session.

I don't think machinectl login handles this for you either, which is sad given how it talks to systemd inside the container.

If you run an SSH server inside the container, then just use that, SSH will forward TERM correctly and you don't have to do anything.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.