From f28b6f439def3aee4070bd59a829c5274977a9d8 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Sun, 2 Mar 2025 15:24:45 +0100 Subject: [PATCH] Support fish when running shell command This should allow using custom shell functions in lazygit's : prompt. --- pkg/commands/oscommands/os_default_platform.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/commands/oscommands/os_default_platform.go b/pkg/commands/oscommands/os_default_platform.go index beb767723..065d7f297 100644 --- a/pkg/commands/oscommands/os_default_platform.go +++ b/pkg/commands/oscommands/os_default_platform.go @@ -16,7 +16,9 @@ func GetPlatform() *Platform { interactiveShellArg := "-i" interactiveShellExit := "; exit $?" - if !(strings.HasSuffix(shell, "bash") || strings.HasSuffix(shell, "zsh")) { + if strings.HasSuffix(shell, "fish") { + interactiveShellExit = "; exit $status" + } else if !(strings.HasSuffix(shell, "bash") || strings.HasSuffix(shell, "zsh")) { interactiveShell = "bash" interactiveShellArg = "" interactiveShellExit = ""