From be7fdbb168a3fa5f94cde09efda1546b22610d97 Mon Sep 17 00:00:00 2001 From: sn Date: Sat, 7 Feb 2026 07:03:10 +0600 Subject: [PATCH] fix: check ctx.ui existence when hasUI is false When running 'pi' directly with a TTY, ctx.hasUI can sometimes be false even though the TUI is fully functional and ctx.ui is available. This fix allows the interactive shell to work if ctx.ui exists, regardless of the hasUI flag. --- index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.ts b/index.ts index a82fd4e..4386122 100644 --- a/index.ts +++ b/index.ts @@ -361,7 +361,9 @@ export default function interactiveShellExtension(pi: ExtensionAPI) { }; } - if (!ctx.hasUI) { + // Relaxed check: allow if ctx.ui exists even if hasUI is false + // (workaround for edge cases where TUI is visible but hasUI=false) + if (!ctx.hasUI && !ctx.ui) { return { content: [{ type: "text", text: "Interactive shell requires interactive TUI mode" }], isError: true,