Skip to content

Commit 104d03d

Browse files
authored
Merge pull request #806 from rumpl/acp-ctrl-c
Stop acp on ctrl+c
2 parents 0cf3be6 + 55a9e76 commit 104d03d

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

cmd/root/acp.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ func (f *acpFlags) runACPCommand(cmd *cobra.Command, args []string) error {
5858
defer acpAgent.Stop(ctx)
5959

6060
slog.Debug("acp started, waiting for conn")
61-
<-conn.Done()
62-
63-
return nil
61+
select {
62+
case <-ctx.Done():
63+
return ctx.Err()
64+
case <-conn.Done():
65+
return nil
66+
}
6467
}

0 commit comments

Comments
 (0)