mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-01 04:41:14 -03:00
__fish_hg_prompt: Only show current bookmark
This commit is contained in:
@@ -37,11 +37,13 @@ function __fish_hg_prompt --description 'Write out the hg prompt'
|
||||
return
|
||||
end
|
||||
|
||||
set -l bookmark (hg bookmark -q)
|
||||
# Unfortunately, hg bookmark doesn't exit non-zero when there's no bookmark
|
||||
if test -n "$bookmark"
|
||||
set branch "$branch/$bookmark"
|
||||
end
|
||||
# With "-q", hg bookmark will always output every bookmark
|
||||
# So our only option is to filter it ourselves
|
||||
set -l bookmark (hg bookmark | string match ' \\**' | cut -d" " -f3)
|
||||
# Unfortunately, hg bookmark doesn't exit non-zero when there's no bookmark
|
||||
if test -n "$bookmark"
|
||||
set branch "$branch/$bookmark"
|
||||
end
|
||||
|
||||
echo -n '|'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user