From 682e54222c5f552d3cc4d18d23169c707179e1e4 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Fri, 14 Jun 2024 17:21:34 +0200 Subject: [PATCH] Don't wait for debugger in daemon mode When debugging an integration test that involves some behind-the-scenes rebasing, the daemon lazygit would also wait for a debugger to attach. This is very confusing because the test seems to hang; once you figured out what's going on, it's inconvenient because you need to attach a debugger to the daemon every time you debug the test. Now, it would sometimes be useful to be able to debug the daemon itself (whether inside an integration test, or during normal usage), and I have often wished to be able to do that. We might introduce an additional env var (and command-line option?) to enable this; but that's out of scope here. --- pkg/integration/clients/injector/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/integration/clients/injector/main.go b/pkg/integration/clients/injector/main.go index 1f4c845e8..96a4fb1f0 100644 --- a/pkg/integration/clients/injector/main.go +++ b/pkg/integration/clients/injector/main.go @@ -31,7 +31,7 @@ func main() { integrationTest := getIntegrationTest() - if os.Getenv(components.WAIT_FOR_DEBUGGER_ENV_VAR) != "" { + if os.Getenv(components.WAIT_FOR_DEBUGGER_ENV_VAR) != "" && !daemon.InDaemonMode() { println("Waiting for debugger to attach...") for !isDebuggerAttached() { time.Sleep(time.Millisecond * 100)