aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions/prompt_pwd.fish
diff options
context:
space:
mode:
authorGravatar Konrad Borowski <glitchmr@myopera.com>2013-08-14 12:11:09 +0300
committerGravatar Konrad Borowski <glitchmr@myopera.com>2013-08-14 12:11:09 +0300
commitfeb36e7342cf782e7723fe41eb2c414ec2879800 (patch)
tree7a21cc598a1d8d90613dc7728cc23f278dde65a9 /share/functions/prompt_pwd.fish
parent8ab81e6d4b24c965ea0f7191a29e332f803df4ba (diff)
Show drive letter under Cygwin
/c/c looks awful, and C:/ is simply better.
Diffstat (limited to 'share/functions/prompt_pwd.fish')
-rw-r--r--share/functions/prompt_pwd.fish4
1 files changed, 4 insertions, 0 deletions
diff --git a/share/functions/prompt_pwd.fish b/share/functions/prompt_pwd.fish
index 716372f4..ed6eb3d9 100644
--- a/share/functions/prompt_pwd.fish
+++ b/share/functions/prompt_pwd.fish
@@ -2,6 +2,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'
end
+else if test (uname -o) = Cygwin
+ function prompt_pwd --description "Print the current working directory, shortend to fit the prompt"
+ echo $PWD | sed -e "s|^$HOME|~|" -e 's|^/cygdrive/\(.\)|\1/:|' -e 's-\([^/.]\)[^/]*/-\1/-g' -e 's-^\([^/]\)/:/\?-\u\1:/-'
+ 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'