Tmux Powerline Special Characters Issue

Tmux is a terminal multiplexer like Screen on steroids. It is faster, slicker and much more easily extendable than screen. For why you might want to try tmux over screen checkout these articles :

Tmux Powerline is an extension to tmux’s statusline which makes it look incredibly cool. Look at this screenshot:

Image
Tmux Powerline.

There are 2 projects that provide this feature.

The second one by Lokaltog, originally was a plugin for vim that inspired tmux-powerline, today it is the right choice and has bindings for most shells, vim and even tmux, so it can be used as a single solution for all. The installation instructions are simple.

However when I initially installed it, I was facing a weird issue, something that I didn’t find much information on. No one seemed to have faced a similar issue or reported any relavant fixes. See the screenshot below to get an idea about the issue. Notice how the status line is crooked?

Image
Tmux Powerline Special Characters Issue.

After a lot of digging around I was able to deduce that the issue was because tmux wasn’t supporting UTF-8 characters. After a lot of attempts I found a temporary fix by simply using tmux -u which forces tmux to use UTF-8 instead of trying to figure out UTF-8 support from the system locale. And it magically fixed the issue!

From that then I went and manually edited the /etc/defaults/locale and switched my LANG=en_IN to LANG=en_IN.UTF-8. You can use the command locale -a to figure out what locale is supported by your system and use one that you think is appropriate, but ensure you use the UTF-8 one. After this change I had to restart my system and the problem was fixed permanently. Hope it helps others who may be facing similar issues.

comments powered by Disqus