Skip to content

fix: handle resourceUri in Open with File for explorer context menu#11

Open
eekwong wants to merge 1 commit into
pithings:mainfrom
eekwong:fix/open-with-file-explorer-context
Open

fix: handle resourceUri in Open with File for explorer context menu#11
eekwong wants to merge 1 commit into
pithings:mainfrom
eekwong:fix/open-with-file-explorer-context

Conversation

@eekwong

@eekwong eekwong commented May 24, 2026

Copy link
Copy Markdown

When 'Pi: Open with File' is invoked from the explorer context menu, VS Code passes the selected file's URI as an argument. Previously this was ignored, so the command always fell back to the active editor and used the first workspace folder as cwd.

Changes:

  • Accept resourceUri parameter in the openWithFile command handler
  • buildOpenWithFileContext() prefers the explicit resourceUri over the active editor, and resolves the correct workspace folder for the file
  • Return cwd alongside contextLines so the terminal starts in the matching workspace folder (important for multi-root workspaces)
  • createNewTerminal() accepts an optional cwd override

When 'Pi: Open with File' is invoked from the explorer context menu,
VS Code passes the selected file's URI as an argument. Previously this
was ignored, so the command always fell back to the active editor and
used the first workspace folder as cwd.

Changes:
- Accept resourceUri parameter in the openWithFile command handler
- buildOpenWithFileContext() prefers the explicit resourceUri over the
  active editor, and resolves the correct workspace folder for the file
- Return cwd alongside contextLines so the terminal starts in the
  matching workspace folder (important for multi-root workspaces)
- createNewTerminal() accepts an optional cwd override
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.

1 participant