fish_prompt: Don't do work outside of the function

That just makes it annoying to use `funced`.

Also sync the classic_vcs prompt again.
This commit is contained in:
Fabian Homborg
2020-08-27 17:02:58 +02:00
parent d00e0ee64b
commit f88c3389da
2 changed files with 11 additions and 4 deletions

View File

@@ -1,8 +1,6 @@
# name: Classic + Vcs
# name: Classic + Vcs (the default)
# author: Lily Ballard
set __fish_prompt_status_generation $status_generation
function fish_prompt --description 'Write out the prompt'
set -l last_pipestatus $pipestatus
set -l last_status $status
@@ -25,7 +23,9 @@ function fish_prompt --description 'Write out the prompt'
end
# Write pipestatus
# If the status was carried over (e.g. after `set`), don't bold it.
set -l bold_flag --bold
set -q __fish_prompt_status_generation; or set -g __fish_prompt_status_generation $status_generation
if test $__fish_prompt_status_generation = $status_generation
set bold_flag
end