1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-08-01 19:18:28 -04:00

core/completions: handle QS timeouts instead of hanging

related #1404
This commit is contained in:
bbedward
2026-07-05 23:10:51 -04:00
parent 6ec67cefd0
commit bddcdb3f99
+9 -2
View File
@@ -582,7 +582,11 @@ func runShellDaemon(session bool) {
}
var qsHasAnyDisplay = sync.OnceValue(func() bool {
out, err := exec.Command("qs", "ipc", "--help").Output()
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
defer cancel()
cmd := exec.CommandContext(ctx, "qs", "ipc", "--help")
cmd.WaitDelay = 500 * time.Millisecond
out, err := cmd.Output()
if err != nil {
return false
}
@@ -642,7 +646,10 @@ func getShellIPCCompletions(args []string, _ string) []string {
return nil
}
cmdArgs := append(baseArgs, "show")
cmd := exec.Command("qs", cmdArgs...)
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
defer cancel()
cmd := exec.CommandContext(ctx, "qs", cmdArgs...)
cmd.WaitDelay = 500 * time.Millisecond
var targets ipcTargets
if output, err := cmd.Output(); err == nil {