mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-22 10:06:49 +08:00
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.
This commit is contained in:
parent
2f332f0019
commit
6c9c033126
|
@ -1,3 +1,3 @@
|
||||||
function prompt_hostname --description 'short hostname for the prompt'
|
function prompt_hostname --description 'short hostname for the prompt'
|
||||||
string replace -r "\..*" "" $hostname
|
string replace -r -- "\..*" "" $hostname
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user