From 29d991310ee370f79ccfe1775ef8aa02fbbc5e1d Mon Sep 17 00:00:00 2001 From: hedy Date: Sun, 3 Apr 2022 01:54:43 +0000 Subject: [PATCH] Fish: Fix prompt for fish v3.4.1 Removed my own copy of prompt_pwd because fish keeps saying "-d: unknown option". I hadn't changed anything in the function anyway, so it should just use the built-in one in /usr/share/fish/functions and it should work as before. --- .config/fish/functions/prompt_pwd.fish | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 .config/fish/functions/prompt_pwd.fish diff --git a/.config/fish/functions/prompt_pwd.fish b/.config/fish/functions/prompt_pwd.fish deleted file mode 100644 index e055e62..0000000 --- a/.config/fish/functions/prompt_pwd.fish +++ /dev/null @@ -1,26 +0,0 @@ -# Based on the built-in prompt_pwd. -function prompt_pwd --description "Print the current working directory, shortened to fit the prompt" - set -l options h/help - argparse -n prompt_pwd --max-args=0 $options -- $argv - or return - - if set -q _flag_help - __fish_print_help prompt_pwd - return 0 - end - - # This allows overriding fish_prompt_pwd_dir_length from the outside (global or universal) without leaking it - set -q fish_prompt_pwd_dir_length - or set -l fish_prompt_pwd_dir_length 1 - - # Replace $HOME with "~" - set -l realhome ~ - set -l tmp (string replace -r '^'"$realhome"'($|/)' '~$1' $PWD) - - if [ $fish_prompt_pwd_dir_length -eq 0 ] - echo $tmp - else - # Shorten to at most $fish_prompt_pwd_dir_length characters per directory - string replace -ar '(\.?[^/]{'"$fish_prompt_pwd_dir_length"'})[^/]*/' '$1/' $tmp - end -end