oh-my-fish / oh-my-fish-legacy

Oh My Fish!
MIT License
13 stars 2 forks source link

Theme right prompt overflows #471

Closed Altynai closed 9 years ago

Altynai commented 9 years ago

I updated oh-my-fish today, something weird happened, When I'm using the theme thebobfish, the right promopt in iTerm2 overflows like the image follows: image

I tried to change the format of the date, but it didn't work :( my environment: OSX, 10.10.3 iTerm2, Build 2.1.1 fish, version 2.1.0

bobthecow commented 9 years ago

Weird. It looks like you have two right prompts, somehow.

I'm assuming you ran omf install and/or omf update after updating?

Try opening themes/bobthefish/fish_right_prompt.fish and renaming the function to something else, then reloading fish. Do you still see a right prompt?

riverssteve commented 9 years ago

I had the same problem with iTerm2. Turns out I had "treat ambiguous width characters as double width" set under Preferences -> Profile -> Text.

Altynai commented 9 years ago

I did omf update after updating, it shows: image

then I renamed themes/bobthefish/fish_right_prompt.fish to some_temp_file and reloaded the fish, the right prompt was gone, as expected: image

so it seems only one right prompt exists.

Altynai commented 9 years ago

@riverssteve Thanks bro :+1: It works for me!

bobthecow commented 9 years ago

Good to know! :+1:

bpinto commented 9 years ago

Do you know why this would cause this problem @bobthecow

bobthecow commented 9 years ago

@bpinto because the powerline glyphs are an unknown width — they put them at an undefined codepoint, so iTerm has no idea whether they're single or double wide glyphs. So if you have that setting enabled, iTerm just makes everything it doesn't understand act like it's double wide, which means fish's native right prompt spacing is off.