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

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

Screenshot from 2013-02-23 12:21:31

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.Screenshot from 2013-02-22 18:51:51

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 utf8 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.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

12 Trackbacks