cirho / powerline-rust

powerline-shell written in Rust
MIT License
51 stars 25 forks source link

Git icons not showing properly in Zsh #13

Closed sumanthratna closed 4 years ago

sumanthratna commented 4 years ago

On macOS 10.15.5 Beta and zsh 5.7.1 (x86_64-apple-darwin19.0), this is what I see:

myterm

This is the output of git status:

On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
    deleted:    prompt/powerline-go

Untracked files:
  (use "git add <file>..." to include in what will be committed)
    envvars/cargo
    prompt/powerline-rust

no changes added to commit (use "git add" and/or "git commit -a")
cirho commented 4 years ago

I don't exactly know what you mean, because for me git icons are showing correctly. Is it about wrong arrow symbol color or something else? Please specify.

Regarding colors, I also use zsh and it works fine so it looks like a terminal emulator issue.

sumanthratna commented 4 years ago

I would expect a 1 to be in the orange segment to show that there is 1 file that is not staged. I would also expect a 2 to be in the red segment to show that there are 2 files that are untracked.

Further, I would expect the icon in the red segment to be something other than a red question mark.

The colors are okay.

cirho commented 4 years ago

I would expect a 1 to be in the orange segment to show that there is 1 file that is not staged.

There is no 1 in orange segment, because there is only one not staged file. It's a design choice in order to shorten prompt length. With 2 or more not staged files number will show up.

I would also expect a 2 to be in the red segment to show that there are 2 files that are untracked.

There is 2 in the screenshot.

Further, I would expect the icon in the red segment to be something other than a red question mark.

Question mark is a utf8 symbol. I've got a white one, because it's a font dependent thing. Normal question mark would be to subtle.

Most elements are simply ported from b-ryan/powerline-shell.

sumanthratna commented 4 years ago

Ahh looks like these are just some unexpected (at least for me) design choices.

I would expect a 1 to be in the orange segment to show that there is 1 file that is not staged.

There is no 1 in orange segment, because there is only one not staged file. It's a design choice in order to shorten prompt length. With 2 or more not staged files number will show up.

Is there an option to customize this? It looks like the relevant code is here: https://github.com/cirho/powerline-rust/blob/master/src/modules/git.rs#L100-L106 but I don't know if I can change this setting—I think I'd prefer the 1 to show.

I would also expect a 2 to be in the red segment to show that there are 2 files that are untracked.

There is 2 in the screenshot.

You're right, I was being silly.

Further, I would expect the icon in the red segment to be something other than a red question mark.

Question mark is a utf8 symbol. I've got a white one, because it's a font dependent thing. Normal question mark would be too subtle.

Most elements are simply ported from b-ryan/powerline-shell.

Can I hide the question mark? I now understand why a question mark is appropriate for untracked files, but it doesn't seem to obvious. I personally like the way https://github.com/justjanne/powerline-go shows the git segment (see https://github.com/justjanne/powerline-go/blob/master/README.md#version-control)

cirho commented 4 years ago

I don't really know what is better, but one day maybe I will change it. You can always fork project, change or edit your font to suit your taste.