mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-29 05:03:46 +08: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.
4 lines
120 B
Fish
4 lines
120 B
Fish
function prompt_hostname --description 'short hostname for the prompt'
|
|
string replace -r -- "\..*" "" $hostname
|
|
end
|