mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-28 09:31:16 -03:00
Autodetect common escape codes in fish_prompt output
darcs-hash:20051213101859-ac50b-0ff01bb168d894d401d3d93cc11740789bac0d62.gz
This commit is contained in:
@@ -915,17 +915,11 @@ The default \c fish prompt is
|
||||
<p>
|
||||
<pre>
|
||||
function fish_prompt -d "Write out the prompt"
|
||||
printf '\%s\@\%s\%s\\n\%s\%s\\n> ' (whoami) (hostname|cut -d . -f 1) (set_color \$fish_color_cwd) (prompt_pwd) (set_color normal)
|
||||
printf '\%s\@\%s\%s\%s\%s> ' (whoami) (hostname|cut -d . -f 1) (set_color \$fish_color_cwd) (prompt_pwd) (set_color normal)
|
||||
end
|
||||
</pre>
|
||||
</p>
|
||||
|
||||
If you are using \c set_color or other commands that output escape
|
||||
codes to change the font settings of the terminal, you must always and
|
||||
every such sequence with a newline. This is needed since fish needs to
|
||||
know that exact length of the prompt in order to tetect when the
|
||||
cursor reaches the end of the line. Any newlines in the output of the
|
||||
\c fish_prompt command are ignored.
|
||||
|
||||
\subsection title Programmable title
|
||||
|
||||
|
||||
Reference in New Issue
Block a user