Skip to content

[Terminal] Windows: drag and droping a tab from the workspace returns an invalid path #29926

Closed

Description

  • VSCode Version: Insider
  • OS Version: Windows 10 64 bit

Steps to Reproduce:

  1. Drag and drop a tab from the editor onto the integrated terminal

What happens?

A unix-like path is copied, like: /e:/docs/Dev/test.js. This path is invalid and cannot be used into the terminal without replacing the slashes with backslashes and removing the first slash.

What should happen?

This should copy a Windows path: e:\docs\Dev\test.js

Activity

  1. added
    terminal
    on Jun 30, 2017
  2. changed the title [-][Terminal] Windows: drag and droping a tab from the workspace uses unix separators[/-] [+][Terminal] Windows: drag and droping a tab from the workspace returns an invalid path[/+] on Jun 30, 2017
  3. added
    bug
    help wanted
    on Jun 30, 2017
  4. added this to the Backlog milestone on Jun 30, 2017
  5. rianadon commented on Jul 2, 2017

    @rianadon
    Contributor

    The path should also be compatible with other shells, such as bash under WSL or Git Bash.

    This would require another setting though, unless it is assumed the executable names are never changed by people.

  6. warpdesign commented on Jul 2, 2017

    @warpdesign
    ContributorAuthor

    Question is, how do you know which environment you're running on?

    I'm not sure this can be properly guessed. The terminal.integrated.shell.oscould be used but nothing stops the user from running bash even though integrated shell is set to cmd.exe on Windows for example.

  7. rianadon commented on Jul 2, 2017

    @rianadon
    Contributor

    Good point. I'm not sure either. The only way may be to analyze prompt strings / prefixes, unless there is a way to get the most nested process running in the shell.

  8. nico-onmap commented on Jul 3, 2017

    @nico-onmap

    In the meantime maybe it could be fixed so that it works in at least one environment (I would suggest cmd.exe), because right now, the path's that's returned (/e:/docs/Dev/test.js) isn't valid in any environment (cmd/bash).

  9. rianadon commented on Jul 3, 2017

    @rianadon
    Contributor

    It turns out there is a way to query child processes of the shell, and I created a PR (#30070) that does this. The querying does add some latency though, so keeping the path always Windows-formatted could be a better way to go.

  10. warpdesign commented on Jul 3, 2017

    @warpdesign
    ContributorAuthor

    Nice work rianadon!

    I'd vote for simply formatting paths as Windows by default, and have an option to use your method.

  11. Tyriar commented on Jul 5, 2017

    @Tyriar
    Contributor

    rianadon it looks like you've stumbled onto something I've been wanting for a while in wmic.exe. I made a note in #20676 (comment) 🍻

  12. warpdesign commented on Aug 10, 2017

    @warpdesign
    ContributorAuthor

    Daniel Imms (@Tyriar) It's supposed to be fixed according to the VSCode 1.15 release notes but it still returns an invalid path on Windows 10 with cmd.exe: (Creators Update)

    /c:/Users/warpd/Dev/athenajs-tetris/js/flash_lines.js

  13. Tyriar commented on Aug 18, 2017

    @Tyriar
    Contributor

    I just fixed this today (before I saw this issue). #32734 it was happening because we were getting the URI path, not the file path. rianadon's change to get different shells formatting the path differently is blocked on #31818 which is actively being worked on.

  14. Tyriar commented on Aug 18, 2017

    @Tyriar
    Contributor

    I'll keep it open until other shell paths are handled correctly

  15. added
    windows
    on Jul 11, 2018
  16. added
    verified
    on Sep 27, 2018
  17. locked and limited conversation to collaborators on Oct 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bughelp wantedterminalverifiedwindows

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions