From da4174e0f5180b62cf9e76d452ca841d149bac96 Mon Sep 17 00:00:00 2001 From: crschnick Date: Sat, 9 Nov 2024 04:28:16 +0000 Subject: [PATCH] Terminal launch fixes --- .../java/io/xpipe/app/terminal/TerminalLaunchRequest.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/xpipe/app/terminal/TerminalLaunchRequest.java b/app/src/main/java/io/xpipe/app/terminal/TerminalLaunchRequest.java index 339024148..bfb228e85 100644 --- a/app/src/main/java/io/xpipe/app/terminal/TerminalLaunchRequest.java +++ b/app/src/main/java/io/xpipe/app/terminal/TerminalLaunchRequest.java @@ -34,11 +34,15 @@ public class TerminalLaunchRequest { public Path waitForCompletion() throws BeaconServerException { while (true) { - if (getResult() == null) { + if (latch.getCount() > 0) { ThreadHelper.sleep(10); continue; } + if (getResult() == null) { + throw new BeaconServerException("Launch request aborted"); + } + var r = getResult(); if (r instanceof TerminalLaunchResult.ResultFailure failure) { var t = failure.getThrowable();