Support fish when running shell command (#4350)

- **PR Description**

This should allow using custom shell functions in lazygit's : prompt.

Fixes #4342.
This commit is contained in:
Stefan Haller 2025-03-06 08:14:48 +01:00 committed by GitHub
commit ddc14ef674
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 = ""