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