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.
This commit is contained in:
Stefan Haller 2024-06-14 17:21:34 +02:00
parent 89ba3f2b1a
commit 682e54222c

View file

@ -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)