From 60652c2bd2d1bbce26c90a010913f0f0d8e9365f Mon Sep 17 00:00:00 2001 From: Konrad Borowski Date: Sun, 19 May 2013 10:58:40 +0200 Subject: [PATCH] Show first two characters for dotdirs. Fixes #754. --- share/functions/prompt_pwd.fish | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/functions/prompt_pwd.fish b/share/functions/prompt_pwd.fish index cbc947292..df5e6c995 100644 --- a/share/functions/prompt_pwd.fish +++ b/share/functions/prompt_pwd.fish @@ -1,10 +1,10 @@ if test (uname) = Darwin function prompt_pwd --description "Print the current working directory, shortend to fit the prompt" - echo $PWD | sed -e "s|^$HOME|~|" -e 's|^/private||' -e 's-\([^/]\)[^/]*/-\1/-g' + echo $PWD | sed -e "s|^$HOME|~|" -e 's|^/private||' -e 's-\(\.\?[^/.]\)[^/]*/-\1/-g' end else function prompt_pwd --description "Print the current working directory, shortend to fit the prompt" - echo $PWD | sed -e "s|^$HOME|~|" -e 's-\([^/]\)[^/]*/-\1/-g' + echo $PWD | sed -e "s|^$HOME|~|" -e 's-\(\.\?[^/.]\)[^/]*/-\1/-g' end end