Show path containing current disk drive in Windows in title

This commit is contained in:
Konrad Borowski 2013-08-14 12:21:17 +03:00
parent feb36e7342
commit d407d680ea
2 changed files with 11 additions and 2 deletions

View File

@ -111,7 +111,7 @@ commence.
fish specific commands, meaning it will work even if fish is not
installed. This is used by read_i.
*/
#define DEFAULT_PROMPT L"echo -n \"$USER@\"(hostname|cut -d . -f 1)' '(pwd)'> '"
#define DEFAULT_PROMPT L"echo -n \"$USER@\"(hostname|cut -d . -f 1)' '(__fish_pwd)'> '"
/**
The name of the function that prints the fish prompt
@ -127,7 +127,7 @@ commence.
/**
The default title for the reader. This is used by reader_readline.
*/
#define DEFAULT_TITLE L"echo $_ \" \"; pwd"
#define DEFAULT_TITLE L"echo $_ \" \"; __fish_pwd"
/**
The maximum number of characters to read from the keyboard without

View File

@ -0,0 +1,9 @@
if test (uname -o) = Cygwin
function __fish_pwd --description "Show current path"
pwd | sed -e 's-^/cygdrive/\(.\)/\?-\u\1:/-'
end
else
function __fish_pwd --description "Show current path"
pwd
end
end