gpakosz / .tmux

🇫🇷 Oh my tmux! My self-contained, pretty & versatile tmux configuration made with ❤️
MIT License
22.03k stars 3.37k forks source link

Powerline not rendered correctly #171

Closed agiuliano closed 6 years ago

agiuliano commented 6 years ago

Hi, I installed PowerlineSymbols.otf but when trying to change the settings to display powerline. This is the result I have. What am I doing wrong?

screen shot 2018-07-20 at 2 44 57 pm

gpakosz commented 6 years ago

Hi @agiuliano 👋

What am I doing wrong?

Installing PowerlineSymbols.otf font I guess? 😅

More seriously. I'm sorry I don't know how to help you. It depends on your OS and your terminal emulator. Please make sure you read https://github.com/gpakosz/.tmux#enabling-the-powerline-look if you didn't already.

Your screenshot clearly shows your editor doesn't render Powerline symbols either. As a first troubleshooting step, I would try installing the Source Code Pro font (which contains the proper powerline symbols) and configure my terminal to use it.

Good luck! 🍀

agiuliano commented 6 years ago

Thanks @gpakosz , I thought I installed PowerlineSymbols.otf by just downloading it and then running fc-cache .fonts. Is that not enough?

gpakosz commented 6 years ago

@agiuliano I honestly don't know. I'm myself using Source Code Pro which has the proper symbols 🤷‍♂️

agiuliano commented 6 years ago

@gpakosz alright thanks, which installation guide you followed?

gpakosz commented 6 years ago

I installed the Source Code Pro font just like any other font

agiuliano commented 6 years ago

I'm using an answer from here but when I comment out tmux_conf_theme_left_separator_main='' I still have the same issue :(

gpakosz commented 6 years ago

I'm sorry but troubleshooting your whole Linux + terminal setup is out of scope for this tmux configuration 😐

You'll have to troubleshoot your setup until the following command prints the Powerline symbols correctly. Please make sure it works outside of tmux first.

$ printf '%b\n' '\ue0b0\ue0b1\ue0b2\ue0b3'

image

Good luck! 🍀

agiuliano commented 6 years ago

thank you @gpakosz !

agiuliano commented 6 years ago

I solved by installing the font on my mac (not on the remote host) and set iTerm to use the patched fonr for powerline

gpakosz commented 6 years ago

Yeah sure. Font has to be configured where the terminal emulator runs.

Thanks @gpakosz , I thought I installed PowerlineSymbols.otf by just downloading it and then running fc-cache .fonts. Is that not enough?

Your comment made me assume you were running everything on Linux

killua99 commented 6 years ago

I don't understand why my tmux can't see powerline symbols.

See the gif for more info.

tmux powerline

gpakosz commented 6 years ago

Hey @killua99 👋

What do you see when you edit your ~/.tmux.conf.local copy outside of tmux. Do you see the powerline symbols?

killua99 commented 6 years ago

Yes I do, I did try that.

I ran printf '\ue0c0' and I see the symbol (outsite tmux) I run it with tmux, and see nothing. I edit with vim the ~/.tmux.conf.local and see the symbol too.

gpakosz commented 6 years ago

What's $TERM outside of tmux?

killua99 commented 6 years ago

both xterm-256color

gpakosz commented 6 years ago

Inside tmux, this should be screen-256color

killua99 commented 6 years ago

Oh, right, I saw wrong, outsite tmux is xterm-256color, inside tmux is screen-256color. My bad I just saw 256 and skip the rest.

gpakosz commented 6 years ago

Alright, are you using an UTF-8 locale? What happens when you export LC_ALL=en_US.UTF-8 before launching tmux?

Also, your animated gif shows you're opening your 26th tmux session. Did you try to kill all tmux processes including the server process after having checked your configuration?

killua99 commented 6 years ago

inside tmux

LANG="en_US.UTF-8"
LC_COLLATE="en_US"
LC_CTYPE="en_US"
LC_MESSAGES="en_US"
LC_MONETARY="en_US"
LC_NUMERIC="en_US"
LC_TIME="en_US"
LC_ALL="en_US"

outside tmux:

LANG="en_US.UTF-8"
LC_COLLATE="en_US"
LC_CTYPE="en_US"
LC_MESSAGES="en_US"
LC_MONETARY="en_US"
LC_NUMERIC="en_US"
LC_TIME="en_US"
LC_ALL="en_US"
gpakosz commented 6 years ago

BTW, $ printf '\ue0c0' isn't a symbol known by my Source Code Pro font here.

But $ printf '\ue0b0' displays the "plain right triangle" symbol.

killua99 commented 6 years ago

If I change them is the same. $ printf '\ue0c0' is a Powerline Nerd Font: https://github.com/ryanoasis/nerd-fonts

gpakosz commented 6 years ago

I'm sorry I don't know then 🤷‍♂️

You may want to launch tmux without my configuration and see whether symbols are printed correctly:

$ tmux -L test -f /dev/null

My experience is that problems with fonts and Powerline symbols is either a terminal emulator issue or a tmux issue, but not a configuration issue.

killua99 commented 6 years ago

was something with fish shell, with the LANG variable, I remove it from fish shell setup and it start working. odd 🤷🏽‍♂️

leopepe commented 4 years ago

Alright, are you using an UTF-8 locale? What happens when you export LC_ALL=en_US.UTF-8 before launching tmux?

Also, your animated gif shows you're opening your 26th tmux session. Did you try to kill all tmux processes including the server process after having checked your configuration?

Had the same problem and setting LC_ALL before calling tmux on my .bashrc fixed it. Tmux need it to render the fonts correctly

JiangtaoLiud commented 4 years ago

Mac: Terminal —— Preference——Profiles——Font——change——choose your font

aminnairi commented 4 years ago

Just a quick message for those having this issue, I am on Archlinux and I forgot to fill my /etc/locale.conf file as stated in the official installation, this has caused my TMUX installation to display weird symbols instead of the powerline ones.

Setting the LC_ALL=en_US.UTF-8 locale inside the /etc/locale.conf file (with administrator privileges) has successfully resolved this issue like said here.

$ sudo vim /etc/locale.conf
LC_ALL=en_US.UTF-8
$ reboot #or logout/login

EDIT:

For interested people, I also wanted to have Powerline with VIM. Unfortunately, that didn't rendered well at first, turns out my TERM was set to screen inside of tmux, but alacritty outside. So if you need to use Powerline, properly set your TERM inside of your *shrc and you'll be good to go.

$ vim ~/.zshrc
export TERM=alacritty # or whatever is your terminal emulator
madrigal1 commented 3 years ago

if you have tried all the above and your symbols aren't rendering correctly try running tmux -u worked for me

tells tmux to use UTF-8

rv-nath commented 3 years ago

Thank you madriga/1. Your suggestion works perfect.

ishtiyaq-td commented 2 years ago

Solved it by adding the following to my .bashrc or .zshrc file:

export LC_ALL=en_IN.UTF-8
export LANG=en_IN.UTF-8
wongjiahau commented 2 years ago

Solved by adding this into my fish config (.config/fish/config.fish):

set -gx LC_ALL en_US.UTF-8

After this, start a new fish session.

MahendraSH commented 8 months ago

I think

tmux -u

will help

and yo can add

alias tmux='tmux -u'