From cc4d8e92bc3918b39fb3439a3d226882dc8341c8 Mon Sep 17 00:00:00 2001 From: dogeystamp Date: Sat, 24 Jun 2023 12:11:48 -0400 Subject: [PATCH] fish-fm: add extra prompt --- src/.local/bin/fish-fm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/.local/bin/fish-fm b/src/.local/bin/fish-fm index 6ab4058..5529611 100755 --- a/src/.local/bin/fish-fm +++ b/src/.local/bin/fish-fm @@ -11,6 +11,23 @@ # sel file1 file2 file3 # +# Save the current fish_prompt function as the function _old_fish_prompt. +functions -c fish_prompt _old_fish_prompt + +# stolen prompt code from python venv +function fish_prompt + # Save the return status of the last command. + set -l old_status $status + + # Output the venv prompt; color taken from the blue of the Python logo. + printf "%s%s%s" (set_color 4B8BBE) "(fishfm) " (set_color normal) + + # Restore the return status of the previous command. + echo "exit $old_status" | . + # Output the original/"old" prompt. + _old_fish_prompt +end + if test -z "$OUTPUT" set OUTPUT /dev/stdout end