aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/tools/web_config/sample_prompts/user_host_path.fish
blob: dbc321a0c6061aa2f11c9f894079af1b419a1718 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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 toor; set prompt_symbol '#'
       case '*';  set prompt_symbol '$'
   end
   printf "[%s@%s %s%s%s]%s " $USER (uname -n) (set_color $fish_color_cwd) $pwd (set_color normal) $prompt_symbol
end