From 2ac01f41bbb232ca0b9d2194ba8a79f03ccb6ec1 Mon Sep 17 00:00:00 2001 From: Tugdual Saunier Date: Thu, 20 Feb 2025 11:44:04 +0100 Subject: [PATCH] Fix Shell guess for completion when `SHELL` is empty --- completion_installer.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/completion_installer.go b/completion_installer.go index f94de50..0795cb2 100644 --- a/completion_installer.go +++ b/completion_installer.go @@ -137,5 +137,9 @@ Add this to the end of your shell configuration file (e.g. "{{ call .RcFil } func GuessShell() string { - return path.Base(os.Getenv("SHELL")) + if shell := os.Getenv("SHELL"); shell != "" { + return path.Base(shell) + } + + return "" }