Skip to content

fix(tui): support Windows and WSL UNC paths in file drag-and-drop - #4

Closed
477174 wants to merge 1 commit into
RobertWsp:devfrom
477174:fix/wsl-file-drag-and-drop
Closed

fix(tui): support Windows and WSL UNC paths in file drag-and-drop#4
477174 wants to merge 1 commit into
RobertWsp:devfrom
477174:fix/wsl-file-drag-and-drop

Conversation

@477174

@477174 477174 commented Mar 2, 2026

Copy link
Copy Markdown

Summary

Fixes #3 — File drag-and-drop doesn't work on WSL (Windows paths not recognized).

  • Adds isWindowsPath(), isFilePath(), resolveDroppedPath() helpers to recognize and convert Windows paths
  • Converts C:\Users\foo/mnt/c/Users/foo on WSL
  • Converts \\wsl$\Ubuntu\home\foo/home/foo on WSL
  • Strips double quotes from dropped paths (Windows Terminal wraps them)
  • Pass-through on native Windows, macOS, and Linux — no behavior change on non-WSL systems

Testing

  1. Run OpenCode in WSL2 via Windows Terminal
  2. Drag a file from Windows Explorer into the prompt
  3. File should be recognized and attached (not pasted as text)

When running opencode in WSL, dragging files from Windows Explorer
pastes Windows-style paths (C:\Users\...) or WSL UNC paths
(\\wsl$\distro\...) which were not recognized by the paste handler.

- Add isWindowsPath/isFilePath/resolveDroppedPath helpers for
  platform-aware path detection and conversion
- Update all path detection guards in onPaste to accept Windows paths
- Convert drive-letter paths to /mnt/<drive>/... on WSL
- Convert \\wsl$/\\wsl.localhost UNC paths to native WSL paths
- Strip double quotes from dropped paths (Windows terminal behavior)
- Pass-through on native Windows and other platforms (no behavior change)

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
@github-actions

github-actions Bot commented Mar 2, 2026

Copy link
Copy Markdown

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions

github-actions Bot commented Mar 2, 2026

Copy link
Copy Markdown

This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

Feel free to open a new pull request that follows our guidelines.

@github-actions github-actions Bot closed this Mar 2, 2026
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.

File drag-and-drop doesn't work on WSL (Windows paths not recognized)

1 participant