mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-12-11 15:53:37 +08:00
69b464bc37
It's now good enough to do so. We don't allow grid-alignment: ```fish complete -c foo -s b -l barnanana -a '(something)' complete -c foo -s z -a '(something)' ``` becomes ```fish complete -c foo -s b -l barnanana -a '(something)' complete -c foo -s z -a '(something)' ``` It's just more trouble than it is worth. The one part I'd change: We align and/or'd parts of an if-condition with the in-block code: ```fish if true and false dosomething end ``` becomes ```fish if true and false dosomething end ``` but it's not used terribly much and if we ever fix it we can just reindent.
27 lines
808 B
Fish
27 lines
808 B
Fish
# name: Classic + Status
|
|
# author: David Frascone
|
|
|
|
function fish_prompt --description "Write out the prompt"
|
|
# Save our status
|
|
set -l last_pipestatus $pipestatus
|
|
|
|
set -l color_cwd
|
|
set -l suffix
|
|
switch "$USER"
|
|
case root toor
|
|
if set -q fish_color_cwd_root
|
|
set color_cwd $fish_color_cwd_root
|
|
else
|
|
set color_cwd $fish_color_cwd
|
|
end
|
|
set suffix '#'
|
|
case '*'
|
|
set color_cwd $fish_color_cwd
|
|
set suffix '>'
|
|
end
|
|
|
|
echo -n -s "$USER" @ (prompt_hostname) ' ' (set_color $color_cwd) (prompt_pwd) \
|
|
(__fish_print_pipestatus " [" "]" "|" (set_color $fish_color_status) (set_color --bold $fish_color_status) $last_pipestatus) \
|
|
(set_color normal) "$suffix "
|
|
end
|