fish-shell/share/functions/prompt_hostname.fish
Paul Gier 6c9c033126 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.
2024-02-22 21:21:31 +08:00

4 lines
120 B
Fish

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