agnoster / agnoster-zsh-theme

A ZSH theme designed to disclose information contextually, with a powerline aesthetic
3.95k stars 583 forks source link

Dark blue directory with black text - wrong colors #72

Open SturmB opened 6 years ago

SturmB commented 6 years ago

I followed all of the instructions (or so I thought) to get zsh installed, as well as oh-my-zsh and its agnoster theme. I also had to get the correct Solarized color themes and install them into terminal.app, as well as the Powerline fonts, including Meslo. Such a big process just to style up terminal to make it look pretty.

And yet, I must still be missing something.

screen shot 2018-04-11 at 1 51 14 pm

For whatever reason, the directory part of the prompt is showing as dark blue with black text. This is happening for both the Solarized Dark and Solarized Light color themes, which makes me think that it isn't in those color themes themselves. Regardless of whether or not it is, how can I fix this issue, as it's clearly not correct?

SturmB commented 6 years ago

I just checked, and this problem also appears no matter which color profile is chosen in macOS' Terminal.app. I also downloaded the latest agnoster.zsh-theme and the problem is still showing when I open new terminal windows.

However, iTerm2 does not appear to have this issue. I can only speculate that I am missing some crucial setting in Terminal.app.

This is very annoying. Is there any way to get the correct color(s)?

watson commented 6 years ago

I have the same problem. I have resorted to typing pwd all the time to see which directory I'm in, but that's not really the best solution. I'm not sure what Terminal.app does different

watson commented 6 years ago

This StackOverflow question and answers might hint at the problem: https://stackoverflow.com/questions/36221252/terminal-and-iterm2-same-profile-ansi-colors-look-differently

watson commented 6 years ago

For now I've "solved" the issue by changing the default ansi color blue in Terminal.app. I've done that by clicking the blue color (top row, 5th from the left) in the Terminal.app color Profiles tab:

screen shot 2018-05-19 at 10 03 06

And then using the color picker to pick the color from the screen shot in this repo:

screen shot 2018-05-19 at 10 04 38
RickyLin commented 6 years ago

I'm using Oh-My-Zsh in Ubuntu 18.04 on Windows. I didn't find out a better solution but finally modified the theme itself.

vim ~/.oh-my-zsh/themes/agnoster.zsh-theme

Change the blue color to whatever color supported by terminal, original theme

For example, I changed it to 076 and it looks like

new folder color

The problem is that I probably have to revert the change before I can update to a new oh-my-zsh version.

SturmB commented 6 years ago

While this is still an issue, I've chosen to abandon the idea of using terminal.app in favor of iTerm2. I do, however, hope this bug (if it is a bug) gets resolved, though.

webloginwu commented 5 years ago

I have the same problem on the latest windows 10 WSL I use the following solution based on RickyLin, the color became perfect.

vi ~/.oh-my-zsh/themes/agnoster.zsh-theme change

prompt_dir() { prompt_segment blue $CURRENT_FG '%~' }

to prompt_dir() { prompt_segment 39d $CURRENT_FG '%~' }

knassef commented 5 years ago

For me this fixed it:

Go to Preferences > Profiles > Colors > Color Presents (on the bottom right) > Choose Solarized Dark

RTrioux commented 5 years ago

For me this fixed it:

Go to Preferences > Profiles > Colors > Color Presents (on the bottom right) > Choose Solarized Dark

Thank you, it worked for me on Plasma / konsole :)

SturmB commented 5 years ago

As I no longer use terminal.app, I am unsubscribing to this issue. I've no idea if it's been resolved with the proposed fixes above, so I'm not sure if I should close this issue, either.

BClev commented 5 years ago

I have the same problem on the latest windows 10 WSL I use the following solution based on RickyLin, the color became perfect.

vi ~/.oh-my-zsh/themes/agnoster.zsh-theme change

prompt_dir() { prompt_segment blue $CURRENT_FG '%~' }

to prompt_dir() { prompt_segment 39d $CURRENT_FG '%~' }

Made this quicker by converting it to a single command: sed -i '0,/blue/{s/blue/39d/}' ~/.oh-my-zsh/themes/agnoster.zsh-theme

thejeff77 commented 4 years ago

Hey guys,

For terminal.app, use the solarized themes from this repository instead. It sets all of the colors correctly.

https://github.com/tomislav/osx-terminal.app-colors-solarized

kohn1001 commented 4 years ago

for me what worked is changing the ansi colors blue and green (normal & bright) to the colors you want to be first-level & second level respectfully

LuigiPower commented 4 years ago

To have the standard white text on dark background in Terminal.app modify the agnoster.zsh-theme by setting PRIMARY_FG=white (or PRIMARY_FG=FFF which if what I'm using), then change

prompt_context() {
  local user=`whoami`

  if [[ "$user" != "$DEFAULT_USER" || -n "$SSH_CONNECTION" ]]; then
    prompt_segment $PRIMARY_FG default " %(!.%{%F{yellow}%}.)$user@%m "
  fi  
}

to

prompt_context() {
  local user=`whoami`

  if [[ "$user" != "$DEFAULT_USER" || -n "$SSH_CONNECTION" ]]; then
    prompt_segment black $PRIMARY_FG " %(!.%{%F{yellow}%}.)$user@%m "           
  fi
} 

I'm new to zsh so I don't know if this has side effects, but it seems to work just fine now.

john1625b commented 3 years ago

Go to Preferences in iterm then Profile then select the dark blue color and make it any light color you want like teal

mutusfa commented 2 years ago

Agnoster doesn't work nicely with solarized dark, even with colors set correctly - context prompt hardcodes "black" color, which is very jarring: image I know I can change it to any value I want, but oh-my-zsh updates can break my changes. Also it would be nice if agnoster changed to white if SOLAROZED_THEME was set to light: image

asagajda commented 1 year ago

On Ubuntu standard terminal theme with oh-my-zsh installed and agnoster theme turned on in ~/.zshrc

I turned this: image

into this: image

by adding into the ~/.zshrc the following:

prompt_dir() {
  # prompt_segment blue $CURRENT_FG '%~'
  prompt_segment blue white '%~'
}

Found the snippet in the ~/.oh-my-zsh/themes/agnoster.zsh-theme, so also it could be edited there.

You can see the default agnoster value prompt_segment blue $CURRENT_FG '%~'

is replaced by prompt_segment blue white '%~'