functions: handle hostname starting with dash
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 6c9c033126417eda1cde6030b195997f78474a05)
This commit is contained in:
parent
c3aefc581f
commit
2655d9a3fa
@ -1,3 +1,3 @@
|
||||
function prompt_hostname --description 'short hostname for the prompt'
|
||||
string replace -r "\..*" "" $hostname
|
||||
string replace -r -- "\..*" "" $hostname
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user