diff --git a/reader.cpp b/reader.cpp index 7753bd759..0e5b45bd4 100644 --- a/reader.cpp +++ b/reader.cpp @@ -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 diff --git a/share/functions/__fish_pwd.fish b/share/functions/__fish_pwd.fish new file mode 100644 index 000000000..d072c6fab --- /dev/null +++ b/share/functions/__fish_pwd.fish @@ -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 \ No newline at end of file