Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed odd chars on mac for agnoster theme #4001

Merged
merged 1 commit into from
Jun 15, 2015

Conversation

ivanfoo
Copy link
Contributor

@ivanfoo ivanfoo commented Jun 14, 2015

Quick fix to solve odd separator char when using agnoster theme on Mac

robbyrussell added a commit that referenced this pull request Jun 15, 2015
Fixed odd chars on mac for agnoster theme
@robbyrussell robbyrussell merged commit 3d2bf22 into ohmyzsh:master Jun 15, 2015
@ncanceill
Copy link
Contributor

Was this really necessary?

I had Agnoster's theme working seamlessly on Mac before this change. Did you have a properly-patched powerline font set up?

@ivanfoo
Copy link
Contributor Author

ivanfoo commented Jun 15, 2015

Hi,

Yes, I have a properly-patched powerline font set up and I couldn't get it
working. In fact, there is an issue about it here:
#1906

2015-06-15 8:56 GMT+02:00 Nicolas Canceill [email protected]:

Was this really necessary?

I had Agnoster's theme working seamlessly on Mac before this change. Did
you have a properly-patched powerline font set up?


Reply to this email directly or view it on GitHub
#4001 (comment)
.

@ncanceill
Copy link
Contributor

OK apparently this was reported in issue 2869. Anyway this should not break anything.


# Fix odd char on mac
if [[ `uname` == 'Darwin' ]]; then
SEGMENT_SEPARATOR='\ue0b0'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want ⮀and not \ue0b0 right? It doesn't work on my machine with a power line font.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How old is your Powerline font? \ue0b0 is the segment separator that Powerline currently uses. They changed the code points they were using a while back, and \ue0b0 is the new one. (I can't tell which other character you're referring to, because my browser isn't using a powerline-patched font. And since there are two versions of the font, pasting the characters directly as single Unicode characters leads to ambiguity, because their appearance is going to depend on which versions of the font people in the conversation have installed.)

@ivanfoo
Copy link
Contributor Author

ivanfoo commented Jun 21, 2015

We want \ue0b0 on Mac boxes and ⮀ on the rest...I have a Linux box too and the fix is working

@ujjwalt
Copy link

ujjwalt commented Jun 25, 2015

The \ue0b0 does not work on my Mac. I have the Menlo power line font. What do you suggest?

@apjanke
Copy link
Contributor

apjanke commented Jun 26, 2015

I suspect it should actually be \ue0b0 everywhere, and this issue is caused by outdated Powerline fonts being installed (see #3713). AFAICT, Powerline doesn't use different Unicode characters on different OSes (which would be weird). But they did change the code points they were using back in 2012, so some machines may have old versions of the fonts installed.

@ivanfoo: When you say "and ⮀ on the rest", I can't tell what character that is, because I don't use Powerline-patched fonts in my browser. (And if I did, it'd still be hard because the appearance would depend on which version I had installed.) What character (Unicode code point) are you referring to? What version (date or md5) of the patched font do you have installed on your Linux box? What's the behavior if you ssh from a terminal on your Mac to your Linux box and run zsh with the agnoster theme there, or vice versa?

@ujjwalt: What exactly does "not work" mean? What are you seeing? Try re-downloading the Menlo Powerline font from https://github.com/powerline/fonts. If \ue0b0 does not work for you, it probably means you have an obsolete version (with old code points) of the font installed.

To test which version of the font you're using (in your local terminal emulator), you can do this.

printf "\ue0b0 \ue0a0 \u2b80 \u00b1 \u27a6 \u2718 \u26a1 \u2699 \n"

If you see a triangle "segment separator" followed by a branch symbol, you are using a current powerline-patched font. (I think.) If you see something else, you're looking at an old, non-patched, or otherwise bad font. E.g. here's what I see on my Mac, using Meslo LG M Regular (MesloLGM-Regular.ttf, md5 c353e3dabba482f3721f67c6a43f1744).

screen shot 2015-06-25 at 8 40 29 pm

I've put in #4091 to clarify this and make it consistent across platforms.

@ujjwalt
Copy link

ujjwalt commented Jun 28, 2015

powerline fail
This is what I see. Menlo seems to be gone. Which font do you recommend? I'll try the one you have mentioned.

@ujjwalt
Copy link

ujjwalt commented Jun 28, 2015

So it does work if I use your font.

@apjanke
Copy link
Contributor

apjanke commented Jun 28, 2015

That means your "Menlo for Powerline" font was an obsolete one with the old code points.

I'd recommend switching to one of the "Meslo LG X for Powerline" variants. (The "X" just indicates different line spacing.) Meslo is a minor variant on Menlo with a few tweaks for on-screen use. You probably won't even notice the difference between them.

@ujjwalt
Copy link

ujjwalt commented Jun 30, 2015

Works perfectly now. You may close this issue.

@apjanke
Copy link
Contributor

apjanke commented Jul 1, 2015

It's already closed. :) ("Merged" counts as closed.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants