Skip to content

fix(tui): render Windows file:// plugin names correctly in /status - #40132

Open
JasonJason-oy wants to merge 1 commit into
anomalyco:devfrom
JasonJason-oy:fix/status-plugin-name-windows
Open

fix(tui): render Windows file:// plugin names correctly in /status#40132
JasonJason-oy wants to merge 1 commit into
anomalyco:devfrom
JasonJason-oy:fix/status-plugin-name-windows

Conversation

@JasonJason-oy

Copy link
Copy Markdown

Issue for this PR

Closes #40131

Type of change

  • Bug fix

What does this PR do?

On Windows, /status derived the plugin name by splitting the fileURLToPath() result on "/", which does not split backslash paths. The whole path became the "filename" and was truncated at the first dot (e.g. "C:\Users\me" for a plugin under the home directory). This PR splits on both "/" and "" so the last path segment (the plugin file name) is used on every platform. The index.ts fallback (parent directory name) is unchanged.

How did you verify your code works?

Verified the derived names with Node for both path styles:

  • file:///C:/Users/me/.config/opencode/plugins/superpowers.js -> superpowers (was "C:\Users\me")
  • file:///home/me/.config/opencode/plugins/superpowers.js -> superpowers (unchanged)
  • file:///home/me/.config/opencode/plugins/my-plugin/index.ts -> my-plugin (unchanged)
  • oh-my-openagent@latest -> oh-my-openagent @latest (unchanged)

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: /status shows truncated name for local file:// plugins on Windows

1 participant