mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-19 09:42:44 +08:00

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
|