mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-02 11:01:15 -03:00
docs/tutorial: Fix prompt display
This displays a colored prompt, which we emulate by adding explicit roles that are translated to css classes. For other things, like "eror" this might not be enough because those often need the rest of the line to still be styled, and I've not found a way to add some explicit styling to a code block. See #5696. [ci skip]
This commit is contained in:
@@ -567,6 +567,9 @@ You can define your own prompt::
|
||||
New Prompt %
|
||||
|
||||
|
||||
.. role:: purple
|
||||
.. role:: yellow
|
||||
|
||||
Multiple lines are OK. Colors can be set via ``set_color``, passing it named ANSI colors, or hex RGB values::
|
||||
|
||||
>_ function fish_prompt
|
||||
@@ -575,9 +578,11 @@ Multiple lines are OK. Colors can be set via ``set_color``, passing it named ANS
|
||||
set_color FF0
|
||||
echo (pwd) '>' (set_color normal)
|
||||
end
|
||||
<span style="color: purple">02/06/13</span>
|
||||
<span style="color: #FF0">/home/tutorial ></span>___
|
||||
|
||||
will look like
|
||||
|
||||
| :purple:`02/06/13`
|
||||
| :yellow:`/home/tutorial >`
|
||||
|
||||
You can choose among some sample prompts by running ``fish_config prompt``. ``fish`` also supports RPROMPT through ``fish_right_prompt``.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user