fish_prompt

Zur Individualisierung des Prompts übers Terminal, auch per SSH. https://fishshell.com/docs/4.1/cmds/set_color.html ist eine große Hilfe…


User

Im Verzeichnis ~/.config/fish/functions/ die Datei fish_prompt.fish erzeugen.

Dort dann z.B.

function fish_prompt
echo $USER@$hostname' $ ' 
end

eingeben.


Root

Im Verzeichnis /root/.config/fish/functions die Datei fish_prompt.fish erzeugen.

Dort dann z.B.

function fish_prompt
echo '['$hostname':'(prompt_pwd)'] # '
end

eingeben.


Weitere Farbbeispiele

Ampel ❯❯❯

function fish_prompt
echo -n (set_color red)$USER(set_color yellow)@(set_color green)$hostname (set_color red)'❯'(set_color yellow)'❯'(set_color green)'❯ '
end

Prompt in Himbeerfarben

function fish_prompt
echo -n (set_color C51A4A); echo '$> '(set_color normal)
end

Prompt in Canonical-Farben

Orangener Text auf Lila Hintergrund
function fish_prompt
echo -n (set_color -o E95420 -b 772953)'ticketsystem $>'(set_color normal)' '
end
Lila Text auf Orangenem Hintergrund
function fish_prompt
echo -n (set_color -o 772953 -b E95420)'sg-wiki $>'(set_color normal)' '
end

Bitte! Es kann immer passieren, dass Anführungszeichen oder Bindestriche formatierungsbedingt falsch dargestellt werden!