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.

VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

9 Comments

 Add your comment
  1. Nice setup. Trying to replicate it I’m having trouble getting the fonts to look good with the arrows in the powerline (even after patching). What font do you use in your screenshots above?

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • I am using Inconsolata for Powerline. You can find patched fonts here – https://github.com/Lokaltog/powerline-fonts

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
      • That’s lovely, thank you. I’ve got powerline working perfectly in vim now. However, I can’t seem to get the one for tmux to work. Did you do anything more than adding ” source ‘{path to powerline}/bindings/tmux/powerline.conf’ ” in .tmux.conf as the installation instructions specifies?

        VA:F [1.9.22_1171]
        Rating: 0 (from 0 votes)
        • Which version of powerline are you using ? There are 2 available, there is the old ‘https://github.com/erikw/tmux-powerline’ and the new ‘https://github.com/Localtog/powerline’, i’d recommend to use the latter.

          VN:F [1.9.22_1171]
          Rating: 0 (from 0 votes)
        • I’m using the new one, which was installed via the pip command listed on the installation instructions. The files are located in ~/Library/Python/2.7/lib/python/site-packages/powerline/

          But, I got it working. Your comment about the powerline and powerline-lint commands made me realize I didn’t have them. After adding ~/Library/Python/2.7/bin to my $PATH, everything seems to be working.

          Thanks :)

          VA:F [1.9.22_1171]
          Rating: 0 (from 0 votes)
  2. Where is your powerline project available ? Make sure the path is correct.
    There’s a ‘powerline’ folder inside of the ‘powerline’ directory which has has the bindings folder.

    it should look something like this : ~/.powerline/powerline/bindings/tmux/powerline.conf

    Also, if you have made any changes to powerline.conf, you should check it by using this command :
    ‘powerline-lint -p ~/path/to/powerline/config_files’

    You can also test in the terminal what the ‘powerline’ command is outputing for tmux using :
    ‘powerline tmux left|right’ if there is any error you’d be able to pick it up from there.

    VN:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  3. Thanks! Couldn’t find why on one of my vm’s my vim/powerline config was acting strange – indeed was the UTF-8 locale setting (it was “en_US”, had to be”en_US.utf8″)

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)

Leave a Reply