Skip to content

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

@477174

Description

@477174

Problem

When running OpenCode in WSL via Windows Terminal, dragging files from Windows Explorer into the OpenCode prompt doesn't work. The dropped file paths are treated as plain text instead of being recognized as file attachments.

This happens because:

  1. Windows paths (C:\Users\...) are not recognized — the paste handler only checks for Unix-style paths (/, ~/, file://)
  2. WSL UNC paths (\\wsl$\Ubuntu\..., \\wsl.localhost\...) are not handled
  3. Windows Terminal wraps dropped paths in double quotes — quotes are not stripped during path detection

Steps to Reproduce

  1. Run OpenCode in WSL2 via Windows Terminal
  2. Drag a file from Windows Explorer into the OpenCode prompt
  3. The file path appears as quoted text instead of being attached

Expected Behavior

Dropped files should be recognized and attached, with automatic path conversion:

  • C:\Users\foo\file.txt/mnt/c/Users/foo/file.txt
  • \\wsl$\Ubuntu\home\foo\file.txt/home/foo/file.txt

Environment

  • WSL2 on Windows
  • Windows Terminal
  • Files dragged from Windows Explorer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions