fish_prompt - определение внешнего вида командной строки
Резюме
fish_prompt
function fish_prompt
...
end
Описание
Функция fish_prompt выполняется при отображении подсказки, а вывод используется в качестве подсказки.
Код возврата команд внутри fish_prompt не изменит значение $status за пределами функции fish_prompt.
fish поставляется с несколькими примерами подсказок, которые можно выбрать с помощью команды fish_config.
Пример
Простая подсказка:
function fish_prompt -d "Write out the prompt"
# This shows up as USER@HOST /home/user/ >, with the directory colored
# $USER and $hostname are set by fish, so you can just use them
# instead of using `whoami` and `hostname`
printf '%s@%s %s%s%s > ' $USER $hostname \
(set_color $fish_color_cwd) (prompt_pwd) (set_color normal)
end
© 2022 fish-shell developers
Licensed under the GNU General Public License, version 2.
https://fishshell.com/docs/3.4/cmds/fish_prompt.html