From b1a1a3b0a72211310e96d5f14631519df8bd3438 Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Mon, 25 Dec 2023 18:46:23 +0100 Subject: [PATCH] prompt_pwd: Fix missing -- Fixes #10169 --- share/functions/prompt_pwd.fish | 2 +- tests/checks/prompt.fish | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/share/functions/prompt_pwd.fish b/share/functions/prompt_pwd.fish index 31d10dee6..89d66b40e 100644 --- a/share/functions/prompt_pwd.fish +++ b/share/functions/prompt_pwd.fish @@ -45,7 +45,7 @@ function prompt_pwd --description 'short CWD for the prompt' continue end - string join / (string replace -ar '(\.?[^/]{'"$fish_prompt_pwd_dir_length"'})[^/]*/' '$1/' $tmp) $full + string join / -- (string replace -ar -- '(\.?[^/]{'"$fish_prompt_pwd_dir_length"'})[^/]*/' '$1/' $tmp) $full end end end diff --git a/tests/checks/prompt.fish b/tests/checks/prompt.fish index d2ddf492a..a600dfff0 100644 --- a/tests/checks/prompt.fish +++ b/tests/checks/prompt.fish @@ -11,3 +11,6 @@ prompt_pwd -D 2 /usr/share/fish/tools/web_config/sample_prompts prompt_pwd -D 0 /usr/share/fish/tools/web_config/sample_prompts # CHECK: /u/s/f/t/w/s + +prompt_pwd -d1 -D 3 /usr/share/fish/tools/web_config/-sample_prompts +# CHECK: /u/s/f/tools/web_config/-sample_prompts