mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-23 02:27:28 +08:00
Show path containing current disk drive in Windows in title
This commit is contained in:
parent
feb36e7342
commit
d407d680ea
|
@ -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
|
||||
|
|
9
share/functions/__fish_pwd.fish
Normal file
9
share/functions/__fish_pwd.fish
Normal 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
|
Loading…
Reference in New Issue
Block a user