fish-shell/share/functions/prompt_hostname.fish
Paul Gier 2655d9a3fa functions: handle hostname starting with dash
If a hostname starts with a dash `-` character, the prompt_hostname function
fails because the `string` function interprets it as an option instead
of an argument.

(cherry picked from commit 6c9c033126)
2024-03-13 18:15:24 +01:00

4 lines
120 B
Fish

function prompt_hostname --description 'short hostname for the prompt'
string replace -r -- "\..*" "" $hostname
end