mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 21:03:12 +00:00
6c9c033126
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.
3 lines
120 B
Fish
3 lines
120 B
Fish
function prompt_hostname --description 'short hostname for the prompt'
|
|
string replace -r -- "\..*" "" $hostname
|
|
end
|