mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-04-15 11:56:37 +02:00
Also, use the user's shell (from the SHELL env variable) instead of bash. Both of these together allow users to use their shell aliases or shell functions in the interactive command prompt.
30 lines
506 B
Go
30 lines
506 B
Go
//go:build !windows
|
|
// +build !windows
|
|
|
|
package oscommands
|
|
|
|
import (
|
|
"os"
|
|
"runtime"
|
|
)
|
|
|
|
func GetPlatform() *Platform {
|
|
return &Platform{
|
|
OS: runtime.GOOS,
|
|
Shell: "bash",
|
|
InteractiveShell: getUserShell(),
|
|
ShellArg: "-c",
|
|
InteractiveShellArg: "-i",
|
|
OpenCommand: "open {{filename}}",
|
|
OpenLinkCommand: "open {{link}}",
|
|
}
|
|
}
|
|
|
|
func getUserShell() string {
|
|
if shell := os.Getenv("SHELL"); shell != "" {
|
|
return shell
|
|
}
|
|
|
|
return "bash"
|
|
}
|