Skip to content

fix(tui): use path.sep for plugin name extraction in /status dialog - #46114

Closed
metal-huang wants to merge 3 commits into
anomalyco:devfrom
metal-huang:fix-plugin-path-windows
Closed

metal-huang wants to merge 3 commits into
anomalyco:devfrom
metal-huang:fix-plugin-path-windows

Conversation

@metal-huang

@metal-huang metal-huang commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #46101

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

On Windows, fileURLToPath() returns backslash-separated paths, but the status dialog was splitting on / only. The entire path became a single token, and the first . in .config made the displayed name C:\Users\Administrator\ instead of rtk.

Changed split("/") to split(path.sep) and renamed the local variable to avoid shadowing the path module import.

How did you verify your code works?

Ran a Node script comparing old vs new logic on a Windows path:

  • Old (split "/"): name = C:\Users\Administrator\
  • New (split path.sep): name = rtk

Screenshots / recordings

See screenshot in linked issue #46101.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes

History: This bug was reported in #34141 and two prior PRs attempted to fix it (#33375, #34183). Both were closed without merging. The bug still exists on dev, re-reported as #46101.

@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Aug 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search, I found a potentially related PR:

Related PR:

Why it's related: This PR also addresses the same issue of rendering plugin names correctly in the status dialog on Windows. It appears to be an earlier attempt at fixing the file path handling issue that the current PR (46114) is addressing. The PR description mentions that prior attempts (#33375, #34183) were closed without merging, and this (#40132) might be another attempt that wasn't merged.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Aug 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@metal-huang

Copy link
Copy Markdown
Contributor Author

Note: #40132 attempts the same fix using split(/[\\/]/) (regex). This PR uses split(path.sep) which is more idiomatic and does not require regex. Either fix resolves the bug — happy to defer to whichever the maintainers prefer.

@metal-huang

Copy link
Copy Markdown
Contributor Author

Friendly ping — this PR has been open for about a month.

The bug is still present in upstream (dialog-status.tsx line 23 still uses path.split("/")), so this fix remains relevant.

Summary: on Windows, fileURLToPath() returns paths with \ separators, but the code splits on /, causing plugin names to render incorrectly in the /status dialog. This PR switches to path.sep for cross-platform correctness.

Happy to rebase or adjust if needed. Thanks!

@github-actions

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

@metal-huang

Copy link
Copy Markdown
Contributor Author

This PR was closed by the automated cleanup bot, but the underlying bug is still present — dialog-status.tsx line 23 still uses path.split("/"), which breaks plugin name rendering on Windows.

The fix is a one-line change (path.split(path.sep)), minimal and safe. I'd appreciate a maintainer taking a look. Happy to rebase or adjust if needed.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TUI /status dialog shows full file path instead of plugin name on Windows

1 participant