mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-12-30 06:53:38 +08:00
4239ba133d
This should be a simple prompt that doesn't place a huge strain on the system but communicates the most important information simply and effectively. It should be a good jumping off point for making your own prompt.
24 lines
522 B
Fish
24 lines
522 B
Fish
# name: Simple
|
|
|
|
function fish_prompt
|
|
# This is a simple prompt. It looks like
|
|
# alfa@nobby /path/to/dir $
|
|
# with the path shortened and colored
|
|
# and a "#" instead of a "$" when run as root.
|
|
set -l symbol ' $ '
|
|
set -l color $fish_color_cwd
|
|
if fish_is_root_user
|
|
set symbol ' # '
|
|
set -q fish_color_cwd_root
|
|
and set color $fish_color_cwd_root
|
|
end
|
|
|
|
echo -n $USER@$hostname
|
|
|
|
set_color $color
|
|
echo -n (prompt_pwd)
|
|
set_color normal
|
|
|
|
echo -n $symbol
|
|
end
|