Skip to content

Windows client: remote file list/stat/read resolves POSIX paths to C:\home\... and fails #21

Closed

Description

@Solaris136

Plugin version

0.8.18

DSH version

0.2.2-rc.1 (DSH Desktop, Windows 11 client). Remote DSH 0.2.1-rc.2 on Ubuntu 24.04 (workspace /home/ubuntu).

Area

Remote files

Reproduction steps

  1. Connect an SSH host and create a remote workspace with path /home/ubuntu (it gets mirrored locally).
  2. With the mirrored Session id, call the plugin's own endpoint (same one the Settings/file UI uses), e.g.:
POST /api/dsh-remote
{"endpoint":"host/files/list","payload":{"sessionId":"<local mirror session id>","path":"/home/ubuntu"}}
  1. Also tried path: ".", path: "/home/ubuntu/.bashrc", and host/files/stat / host/files/read.

Expected behavior

Remote file list / stat / read returns the remote directory contents (/home/ubuntu).

Relevant logs

All calls fail with a Windows-resolved POSIX path:

{"ok":false,"error":{"code":"internal","message":"not found: C:\\home\\ubuntu"}}

path "foo.txt" fails with not found: C:\\home\\ubuntu\\foo.txt.

Probable cause (0.8.18 bundle): targetOf() uses node:path (resolve, isAbsolute, relative, sep) for the remote POSIX path. On Windows, path.resolve("/home/ubuntu") becomes C:\\home\\ubuntu, and that string is sent to the remote agent as remotePath.

Suggested direction: use node:path/posix for remote paths (containment check + remotePath), and keep platform node:path only for the local anchor path.

(No tokens/keys/hostnames included.)

Activity

  1. Golden-Pigeon commented on Nov 9, 2026

    @Golden-Pigeon
    Owner

    Fixed in #25.

    The workspace-files adapter now resolves the local anchor with the client platform path and the remote workspace with POSIX path semantics, so a Windows client sends /home/ubuntu instead of C:\home\ubuntu. The workspace-relative path is converted to / separators before joining the remote root.

    Added 9 path tests covering Windows anchors, relative paths, the workspace root, remote absolute paths outside the root, and escape rejection. Verified on a real Windows host with the Windows node:path: the remote path stays POSIX and the local anchor uses backslashes.

    Thanks @Solaris136 for the detailed report.

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

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