mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-12-01 15:14:26 +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
|