Fix hang when returning from shell command

In 5a3049485c we changed the execution of shell commands to use an interactive
shell (-i), because this allows users to use aliases or shell functions, which
is a nice convenience.

Since then, however, many users have reported problems with lazygit not coming
back to the foreground after executing a shell command. Some users report that
appending "; exit" to the end of the command line solves this. I don't really
understand what the cause of this problem was, or why appending "; exit" solves
it, but if it helps, let's do it.
This commit is contained in:
Stefan Haller 2024-12-23 13:53:28 +01:00
parent ec410b2ae6
commit 5fac40c129
5 changed files with 31 additions and 27 deletions

View file

@ -35,13 +35,14 @@ type OSCommand struct {
// Platform stores the os state
type Platform struct {
OS string
Shell string
InteractiveShell string
ShellArg string
InteractiveShellArg string
OpenCommand string
OpenLinkCommand string
OS string
Shell string
InteractiveShell string
ShellArg string
InteractiveShellArg string
InteractiveShellExit string
OpenCommand string
OpenLinkCommand string
}
// NewOSCommand os command runner