oh-my-fish / theme-agnoster

MIT License
95 stars 64 forks source link

use git, svn and hg prompt only when available #9

Closed derekstavis closed 8 years ago

derekstavis commented 8 years ago

This PR fixes missing checks on VCS prompts which was causing issues when Mercurial isn't available:

fish: Unknown command 'hg'
~/.local/share/omf/themes/agnoster/fish_prompt.fish (line 3):   if command hg id >/dev/null 2>&1
                                                                           ^
in function 'prompt_hg'
    called on line 228 of file ~/.local/share/omf/themes/agnoster/fish_prompt.fish

in function 'fish_prompt'
    called on standard input

in command substitution
    called on standard input
bpinto commented 8 years ago

Seems good to me, but didn't test it. :D

derekstavis commented 8 years ago

@WBTMagnum, @sn0cr, could you guys test it there?

nwykes commented 8 years ago

Request that we also add show_hg_prompt, show_git_prompt, etc. type configs to turn off segments when not desired. I have hg installed, but don't want to use it as it's very slow.

If that belongs in a separate PR let me know and I'll put one together.

nwykes commented 8 years ago

The "use only when available" portion of this PR is working for me.

bobthecow commented 8 years ago

if we add them, please use the same names as bobthefish, for consistency between themes :)

bpinto commented 8 years ago

@bobthecow it seems like we need to create helper functions for themes.

derekstavis commented 8 years ago

When we solve dependencies we can implement a theme plugin :D

bobthecow commented 8 years ago

@bpinto yeah, that would be nice. But for now, it would be enough to just use consistent environment vars to toggle things :)

WBTMagnum commented 8 years ago

@derekstavis tested the PR quickly. works fine here.

@nwykes :+1: on the configuration flags. should probably be a separate PR. regarding the naming, see the bobthefish config flags bobthecow mentioned.

derekstavis commented 8 years ago

Can we merge this? It's pretty urgent :shipit:

bpinto commented 8 years ago

I misread the comments and thought there would be more commits coming, but they are going into another PR. =/