ceejbot / powerline-js

a powerline-style shell prompt builder for node.js
MIT License
49 stars 7 forks source link

bash OS-X Maverics no powerline symbols #2

Open ghost opened 10 years ago

ghost commented 10 years ago

I can't get the poweline prompt to show symbols. Any help appreciated.

I've installed the powerline.js:

npm install powerline 

I've installed the patched font "Droid Sans Mono for Powerline" and confirmed that it contains the powerline symbols (using Font Book.app).

I've set shell locale, it reports:

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

In my .bash_profile I have:

function _update_ps1() {
   export PS1="$(~/node_modules/powerline/powerline.js $? --shell bash --depth 4)";
}
export PROMPT_COMMAND="_update_ps1"

but I still get this (in Terminal.app and in iTerm2):

screenshot 2014-01-04 22 04 58

ghost commented 10 years ago

It seems the seperator char code in the powerline.js doesn't correspond to the characters in the patched font file.

If I open the font "Droid Sans Mono for Powerline" using Font Book.app and copy the characters that's supposed to be used for the different separators, and then paste those into the powerline.js it works:

var SYMBOLS = {
    'compatible':
    {
        separator: '\u25b6',
        separator_thin: '\u276f'
    },
    'patched':
{
        // separator: '\u2B80',
        separator: '',
        // separator_thin: '\u2B81',
        separator_thin: ''
}

};

Now I get a correct looking prompt:

screenshot 2014-01-04 22 33 43

I'd rather have the correct codes. So if anyone knows how I can find the correct unicode character code for the symbols i this patched font it'd be great.

akileez commented 10 years ago

@mikkelbreum Thanks for helping me figure out this problem. I have three systems and only one of them exhibited this problem which baffled me. Ok, when in Font Book.app, goto Preview>Repertoire or command-2. Find the character you are interested in and hover over it. The unicode character will be listed on the bottom like U+E0B0. Insert the last 4 digits (hex code)

 separator: '\u2B80',   // change this to \uE0B0
ghost commented 10 years ago

Thanks @akileez