Skip to content

Pi extension hangs on Linux because openBrowser() uses blocking execSync(xdg-open ...) #288

Closed

Description

@dvic

Summary

On Linux/Hyprland, the Pi extension can hang when Plannotator opens the review UI.

Pi starts listening on a localhost port and opens the browser, but the page hangs. If I close the browser window, Pi unblocks, and then visiting the same URL manually works.

Environment

  • @plannotator/[email protected]
  • Pi 0.58.1
  • Arch Linux
  • Hyprland / Wayland
  • Chromium
  • Local session (not SSH/devcontainer)

Behavior

  • Plannotator opens http://localhost:<port>/
  • Browser page hangs
  • Pi appears blocked
  • Closing the browser window unblocks Pi
  • Opening the same URL manually afterwards works

Suspected cause

In apps/pi-extension/server.ts, openBrowser() uses blocking execSync(...), including on Linux:

execSync(`xdg-open ${JSON.stringify(url)}`, { stdio: "ignore" });

This seems to block Pi while xdg-open is still alive, preventing the local HTTP server from responding.

Notes

While hung, I observed:

  • pi listening on the localhost port
  • xdg-open still running as a child of pi
  • Chromium connected to the port
  • requests to the page timing out

A non-blocking browser launch (spawn(...).unref()) seems safer here.

Activity

  1. backnotprop commented on Mar 14, 2026

    @backnotprop
    Owner

    Investigating

  2. added 2 commits that reference this issue on Mar 14, 2026
    d855d17
    f5705cd
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