Skip to content

feat(webview): cancellable interactive terminal wait without lifetime expiry #198

Closed

Description

@zackees

Refs #155. Coordinated with FastLED/cli#242. Existing WebviewHandle::wait_until_terminal requires a duration and revokes the window when it expires. FastLED interactive viewing must last until user closure, without an arbitrary timeout or Duration::MAX workaround. Add wait_for_terminal over the same resource operation and notifier, no timer or new runtime, preserving typed closure/security outcomes. Dropping the wait future must not revoke the still-owned window; dropping/cancelling the handle retains existing revocation. Preserve existing timed wait semantics.

Acceptance: RED missing method then GREEN; native window-close proof cancels an outstanding wait after a short outer timeout, verifies the backing remains alive, resumes waiting and observes user/window closure. Verify already-terminal state and race-safe rewait; original timeout/cancel proofs stay green. Run Linux native proof and add Windows native execution; full feature checks and crosschecks. Exact published adoption and full FastLED viewer integration remain required.

Activity

  1. zackees commented on Sep 16, 2026

    @zackees
    CollaboratorAuthor

    Complete; closing with the evidence.

    kernal-api — the interactive terminal wait is cancellable and carries no lifetime expiry. src/tauri.rs models it as TerminalCompletion plus a terminal_waiter: Option<OneshotReceiver<Result<(), NativeWebviewError>>>, with a TerminalWaitGuard admitting one waiter at a time (terminal_wait_active).

    Its coverage is in src/bin/kernal-tauri-smoke.rs rather than a unit-test file, which is why a first grep for it comes up empty — worth knowing for anyone looking for it later. The smoke binary races the wait against a deadline and asserts the cancellation outcome explicitly:

    if webview.wait_for_terminal().await != Err(WebviewError::Cancelled) { ... }
    if async_engine::timeout(Duration::from_secs(1), webview.wait_for_terminal()) ...

    That exercises the property the issue names: a caller can abandon the wait on its own terms, rather than being held to the native terminal's lifetime. The smoke binary runs in the tauri-webview-smoke lane and natively on Windows.

    🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions