From dde70486a13e92c387c9a71b30a9cee5bec9f1a3 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Tue, 20 Dec 2022 23:07:43 +1100 Subject: [PATCH] apply user config changes in sandbox mode --- pkg/gui/gui.go | 3 ++- pkg/integration/clients/injector/main.go | 5 ----- pkg/integration/components/runner.go | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go index 1d14c9f50..4fb5cca95 100644 --- a/pkg/gui/gui.go +++ b/pkg/gui/gui.go @@ -32,6 +32,7 @@ import ( "github.com/jesseduffield/lazygit/pkg/gui/services/custom_commands" "github.com/jesseduffield/lazygit/pkg/gui/style" "github.com/jesseduffield/lazygit/pkg/gui/types" + "github.com/jesseduffield/lazygit/pkg/integration/components" integrationTypes "github.com/jesseduffield/lazygit/pkg/integration/types" "github.com/jesseduffield/lazygit/pkg/tasks" "github.com/jesseduffield/lazygit/pkg/theme" @@ -426,7 +427,7 @@ func (gui *Gui) initGocui(headless bool, test integrationTypes.IntegrationTest) playMode = gocui.RECORDING } else if Replaying() { playMode = gocui.REPLAYING - } else if test != nil { + } else if test != nil && os.Getenv(components.SANDBOX_ENV_VAR) != "true" { playMode = gocui.REPLAYING_NEW } diff --git a/pkg/integration/clients/injector/main.go b/pkg/integration/clients/injector/main.go index 37c76fe3e..0754503e8 100644 --- a/pkg/integration/clients/injector/main.go +++ b/pkg/integration/clients/injector/main.go @@ -39,11 +39,6 @@ func getIntegrationTest() integrationTypes.IntegrationTest { return nil } - if os.Getenv(components.SANDBOX_ENV_VAR) == "true" { - // when in sandbox mode we don't want the test controlling the gui - return nil - } - integrationTestName := os.Getenv(components.TEST_NAME_ENV_VAR) if integrationTestName == "" { panic(fmt.Sprintf( diff --git a/pkg/integration/components/runner.go b/pkg/integration/components/runner.go index eab6f9576..47677b3b9 100644 --- a/pkg/integration/components/runner.go +++ b/pkg/integration/components/runner.go @@ -154,7 +154,7 @@ func getLazygitCommand(test *IntegrationTest, paths Paths, rootDir string, sandb cmdObj.AddEnvVars(fmt.Sprintf("%s=%s", TEST_NAME_ENV_VAR, test.Name())) if sandbox { - cmdObj.AddEnvVars(fmt.Sprintf("%s=%s", "SANDBOX", "true")) + cmdObj.AddEnvVars(fmt.Sprintf("%s=%s", SANDBOX_ENV_VAR, "true")) } if keyPressDelay > 0 {