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();