Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
warpdesign opened this issue Jun 30, 2017 · 10 comments · Fixed by #58460
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities terminal Integrated terminal issues verified Verification succeeded windows VS Code on Windows issues

Comments

@warpdesign
Copy link
Contributor

  • 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

@vscodebot vscodebot bot added the insiders label Jun 30, 2017
@vscodebot vscodebot bot added the terminal Integrated terminal issues label Jun 30, 2017
@warpdesign warpdesign 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 Jun 30, 2017
@Tyriar Tyriar added bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities labels Jun 30, 2017
@Tyriar Tyriar added this to the Backlog milestone Jun 30, 2017
@rianadon
Copy link
Contributor

rianadon commented Jul 2, 2017

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.

@warpdesign
Copy link
Contributor Author

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.

@rianadon
Copy link
Contributor

rianadon commented Jul 2, 2017

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.

@nico-onmap
Copy link

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).

@rianadon
Copy link
Contributor

rianadon commented Jul 3, 2017

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.

@warpdesign
Copy link
Contributor Author

Nice work @rianadon!

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

@Tyriar
Copy link
Member

Tyriar commented Jul 5, 2017

@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) 🍻

@warpdesign
Copy link
Contributor Author

warpdesign commented Aug 10, 2017

@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

@Tyriar
Copy link
Member

Tyriar commented Aug 18, 2017

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.

@Tyriar Tyriar closed this as completed Aug 18, 2017
@Tyriar Tyriar reopened this Aug 18, 2017
@Tyriar
Copy link
Member

Tyriar commented Aug 18, 2017

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

@octref octref added the verified Verification succeeded label Sep 27, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Oct 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities terminal Integrated terminal issues verified Verification succeeded windows VS Code on Windows issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants