mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 05:13:10 +00:00
__fish_hg_prompt: Only show current bookmark
This commit is contained in:
parent
a19f4dd4c8
commit
95908aa2bc
1 changed files with 7 additions and 5 deletions
|
@ -37,11 +37,13 @@ function __fish_hg_prompt --description 'Write out the hg prompt'
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
set -l bookmark (hg bookmark -q)
|
# With "-q", hg bookmark will always output every bookmark
|
||||||
# Unfortunately, hg bookmark doesn't exit non-zero when there's no bookmark
|
# So our only option is to filter it ourselves
|
||||||
if test -n "$bookmark"
|
set -l bookmark (hg bookmark | string match ' \\**' | cut -d" " -f3)
|
||||||
set branch "$branch/$bookmark"
|
# Unfortunately, hg bookmark doesn't exit non-zero when there's no bookmark
|
||||||
end
|
if test -n "$bookmark"
|
||||||
|
set branch "$branch/$bookmark"
|
||||||
|
end
|
||||||
|
|
||||||
echo -n '|'
|
echo -n '|'
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue