Skip to content

Plugin popup panes are spawned with the server's cwd, not the plugin root #2050

Description

@stepmixx

Is this a reproducible bug?

  • I confirm this is a reproducible bug, not a feature request, idea, question, contribution proposal, or direction check.
  • I reproduced this bug on the version and environment reported below using the exact steps provided.

Current behavior

A plugin popup pane is spawned with the server's cwd (C:\Windows) instead of the plugin root. An action in the same plugin gets the plugin root.

Same manifest, same probe file, one run of each entrypoint:

pane:   cwd=C:\Windows
action: cwd=C:\Users\steph\AppData\Local\Temp\...\cwdrepro

So a plugin-root-relative command in the manifest works from an action and fails from a popup pane. With command = ["node", "--import", "./compile-cache.js", "picker.ts"] the pane process exits 1 with Cannot find module 'C:\Windows\compile-cache.js', and the popup opens and closes too fast to show it.

Expected behavior

The popup pane process gets the plugin root as its cwd, the same as an action process.

Reproduction

  1. cwdrepro/cwd-probe.mjs:
import fs from "node:fs";
fs.appendFileSync("C:/Windows/Temp/cwd-repro.txt", `${process.argv[2]}: cwd=${process.cwd()}\n`);
  1. cwdrepro/herdr-plugin.toml — both entrypoints run the same file by absolute path, with a different label:
id = "cwdrepro"
name = "cwdrepro"
version = "0.1.0"
min_herdr_version = "0.7.4"
description = "Reports the cwd it was spawned with."
platforms = ["linux", "macos", "windows"]

[[actions]]
id = "probe"
title = "probe"
contexts = ["pane"]
command = ["node", "C:/abs/path/cwdrepro/cwd-probe.mjs", "action"]

[[panes]]
id = "probepane"
title = "probe"
placement = "popup"
width = 40
height = 8
command = ["node", "C:/abs/path/cwdrepro/cwd-probe.mjs", "pane"]
  1. herdr plugin link ./cwdrepro
  2. herdr plugin pane open --plugin cwdrepro --entrypoint probepane
  3. herdr plugin action invoke probe --plugin cwdrepro
  4. Read C:\Windows\Temp\cwd-repro.txt — the two lines disagree.

Impact

Any plugin whose popup entrypoint uses a relative command is broken on Windows, while its actions work, so the failure looks like the popup flashing open and vanishing with nothing in herdr plugin log. It's what kept drovr from running here; I worked around it by passing --cwd from the action that opens the popup.

Environment

  • Herdr version: 0.7.5-preview.2026-07-21-0f10e1453a7f
  • Update channel (stable or preview): preview
  • Operating system: Windows 11 Home 26200.8875
  • Terminal: Windows Console Host (conhost.exe), herdr launched from PowerShell
  • Shell, if relevant: PowerShell 7
  • Relevant config, if any: none

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions