From 38721df853298d425f5ba1b6c583ce7face6f811 Mon Sep 17 00:00:00 2001 From: Stanislav Chernov Date: Fri, 20 Feb 2026 23:11:53 +0300 Subject: [PATCH] fix: prevent freeze when opening config with 'o' key Use non-blocking cmd.Start() with goroutine for Wait() instead of synchronous RunCommand() in OpenFile and OpenLink methods. Fixes jesseduffield/lazydocker#688 --- pkg/commands/os.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/pkg/commands/os.go b/pkg/commands/os.go index b8dec4a0..2aba2d35 100644 --- a/pkg/commands/os.go +++ b/pkg/commands/os.go @@ -161,8 +161,12 @@ func (c *OSCommand) OpenFile(filename string) error { } command := utils.ResolvePlaceholderString(commandTemplate, templateValues) - err := c.RunCommand(command) - return err + cmd := c.ExecutableFromString(command) + if err := cmd.Start(); err != nil { + return err + } + go cmd.Wait() + return nil } // OpenLink opens a file with the given @@ -173,8 +177,12 @@ func (c *OSCommand) OpenLink(link string) error { } command := utils.ResolvePlaceholderString(commandTemplate, templateValues) - err := c.RunCommand(command) - return err + cmd := c.ExecutableFromString(command) + if err := cmd.Start(); err != nil { + return err + } + go cmd.Wait() + return nil } // EditFile opens a file in a subprocess using whatever editor is available,