diff options
Diffstat (limited to 'share/tools/web_config/sample_prompts/user_host_path.fish')
-rw-r--r-- | share/tools/web_config/sample_prompts/user_host_path.fish | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/share/tools/web_config/sample_prompts/user_host_path.fish b/share/tools/web_config/sample_prompts/user_host_path.fish new file mode 100644 index 00000000..c125eea0 --- /dev/null +++ b/share/tools/web_config/sample_prompts/user_host_path.fish @@ -0,0 +1,13 @@ +# name: User, Host, Path +# author: Jon Clayden + +function fish_prompt -d "Write out the prompt" + set -l home_escaped (echo -n $HOME | sed 's/\//\\\\\//g') + set -l pwd (echo -n $PWD | sed "s/^$home_escaped/~/" | sed 's/ /%20/g') + set -l prompt_symbol '' + switch $USER + case root; set prompt_symbol '#' + case '*'; set prompt_symbol '$' + end + printf "[%s@%s %s%s%s]%s " $USER (hostname -s) (set_color $fish_color_cwd) $pwd (set_color normal) $prompt_symbol +end |