From 6c9c033126417eda1cde6030b195997f78474a05 Mon Sep 17 00:00:00 2001 From: Paul Gier Date: Wed, 21 Feb 2024 15:53:21 -0600 Subject: [PATCH] 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. --- share/functions/prompt_hostname.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/functions/prompt_hostname.fish b/share/functions/prompt_hostname.fish index dcb733578..01e510785 100644 --- a/share/functions/prompt_hostname.fish +++ b/share/functions/prompt_hostname.fish @@ -1,3 +1,3 @@ function prompt_hostname --description 'short hostname for the prompt' - string replace -r "\..*" "" $hostname + string replace -r -- "\..*" "" $hostname end