bugfix/make-fish-3-3-compatible #3

Merged
T31M merged 3 commits from bugfix/make-fish-3-3-compatible into master 2022-04-30 11:45:17 +02:00
5 changed files with 121 additions and 114 deletions
Showing only changes of commit 8720d0e19b - Show all commits

View File

@ -29,8 +29,7 @@ end
# Git # Git
function git::is_repo function git::is_repo
test -d .git; or command git rev-parse --git-dir 2>/dev/null 2>/dev/null test -d .git; or command git rev-parse --git-dir >/dev/null 2>/dev/null
# test 0 -eq 1
end end
function git::ahead -a ahead behind diverged none function git::ahead -a ahead behind diverged none
@ -89,22 +88,21 @@ end
function fish_right_prompt function fish_right_prompt
if test "$theme_complete_path" = "yes" # if test "$theme_complete_path" = "yes"
set cwd (prompt_pwd) # set cwd (prompt_pwd)
else # else
set cwd (basename (prompt_pwd)) # set cwd (basename (prompt_pwd))
if git::is_repo # if git::is_repo
set root_folder (command git rev-parse --show-toplevel 2>/dev/null) # set root_folder (command git rev-parse --show-toplevel 2>/dev/null)
set parent_root_folder (dirname $root_folder) # set parent_root_folder (dirname $root_folder)
set cwd (echo $PWD | sed -e "s|$parent_root_folder/||") # set cwd (echo $PWD | sed -e "s|$parent_root_folder/||")
end # end
end # end
# Because of having a two line promt now we dont need right anymore so we dont print anything here atm # Because of having a two line promt now we dont need right anymore so we dont print anything here atm
#printf (yellow)"("(off)$cwd(yellow)") "(off) #printf (yellow)"("(off)$cwd(yellow)") "(off)
#printf (off)(date +%H(yellow):(off)%M(yellow):(off)%S)(off)"\n" #printf (off)(date +%H(yellow):(off)%M(yellow):(off)%S)(off)"\n"
end end

View File

@ -7,7 +7,7 @@ function t31m_prompt_right
set cwd (basename (prompt_pwd)) set cwd (basename (prompt_pwd))
if git::is_repo if git::is_repo
set root_folder (command git rev-parse --show-toplevel 2>/dev/null) set root_folder (command git rev-parse --show-toplevel 2> /dev/null)
set parent_root_folder (dirname $root_folder) set parent_root_folder (dirname $root_folder)
set cwd (echo $PWD | sed -e "s|$parent_root_folder/||") set cwd (echo $PWD | sed -e "s|$parent_root_folder/||")
end end