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

Can't drag files from a remote vscode window to a local window #93599

Open
roblourens opened this issue Aug 12, 2019 · 21 comments
Open

Can't drag files from a remote vscode window to a local window #93599

roblourens opened this issue Aug 12, 2019 · 21 comments
Assignees
Labels
feature-request Request for new features or functionality file-explorer Explorer widget issues
Milestone

Comments

@roblourens
Copy link
Member

  • Have remote and local windows open
  • Drag a file from the remote explorer to the local explorer
  • Nothing happens

I can do this local -> remote to copy files, and I can do this from a remote vscode window to Finder, but not remote -> local vscode windows.

@isidorn
Copy link
Contributor

isidorn commented Aug 13, 2019

The issue here is that the target widnow does not have the remote connection and in this case we can not get the files over in any way.
As @bpasero points out to me this would only work if the target window had the same remote connection

@roblourens
Copy link
Member Author

How is it different from dragging to the desktop though?

@isidorn
Copy link
Contributor

isidorn commented Aug 14, 2019

@roblourens good question. For that I believe we have some URI rewritting logic / configuring chrome to be able to get vscode-remote uri content in place done by @alexandrudima
He can provide a code pointer.
And yes it seems, we could discuss if it is possible to use thisa approach when dragging from window to window @bpasero

@bpasero
Copy link
Member

bpasero commented Aug 14, 2019

For that I believe we have some URI rewritting logic / configuring chrome to be able to get vscode-remote uri content in place done

This only works because we register a protocol handler on the electron main side to handle these URLs.

This would not work on a window that is not connected to the same remote.

@alexdima
Copy link
Member

IMHO the drag & drop feature should not be based on the protocol handler we register. I plan to remove that this milestone because we have bugs with missing icons...

@isidorn
Copy link
Contributor

isidorn commented Aug 14, 2019

Then it seems we might disable the drag and drop feature from remote to desktop since this only works due to the protocol handler. And I do not see any other way to get this to work.
Though we have an alternative feature context menu -> "Download"

@isidorn isidorn transferred this issue from microsoft/vscode-remote-release Mar 27, 2020
@isidorn
Copy link
Contributor

isidorn commented Mar 30, 2020

Looking into a PR to see how feasable this is.

From @bpasero
So it seems obvious that we cannot get the data from the remote because the local window is not connected to that remote. Comparing to web: we support to drop a local file into web where we have a similar problem, since the web cannot read from local files. The code is here:

private async handleWebExternalDrop(data: DesktopDragAndDropData, target: ExplorerItem, originalEvent: DragEvent): Promise<void> {
However this is basically just relying on Chrome filling in the right data transfer. What we could possibly do is add to the data transfer another kind with the actual full data of the file. We may need to limit this though to prevent leaks. We already set some custom transfer types here:
export const CodeDataTransfers = {
and could add another one for data.

@isidorn isidorn added this to the April 2020 milestone Apr 1, 2020
@Tyriar
Copy link
Member

Tyriar commented Apr 14, 2020

Will cut/copy and paste work as part of this work too? I always do that instead of dragging.

@woshiniming007
Copy link

need this feature

@dharmjit
Copy link

dharmjit commented Apr 16, 2020

much needed for remote ssh - Linux. For me both local to remote and vice versa is not working.

@bpasero
Copy link
Member

bpasero commented May 13, 2020

Maybe an alternative to putting all the data into the transfer is to only put the remote resource and then ask the remote window to get the data via some IPC call. E.g.:

  • user drops a remote resource to a local window
  • local window needs to use some service (we probably have to add it) to resolve the content
  • this service could broadcast to windows (via electron-main) and ask the remote window to provide the contents

This would however not solve dropping a remote resource from e.g. insiders to stable VSCode.

@isidorn
Copy link
Contributor

isidorn commented May 29, 2020

Created this PR as work in progress #98817

@avkonst
Copy link

avkonst commented Jun 3, 2020

Just found this issue. I also need upload in addition to download.
I design icons using windows desktop software. And I develop code using VS code connected to remote. I need to modify the icons and other graphics from time to time. SFTP becomes annoying.

@isidorn
Copy link
Contributor

isidorn commented Jun 3, 2020

Futher discussions in the PR #98817
We will not tackle this this milestone, thus pushing out of May

@woshiniming007
Copy link

Is there any update?

@isidorn isidorn added the feature-request Request for new features or functionality label Nov 4, 2020
@Loovelj
Copy link

Loovelj commented Nov 20, 2020

need this feature

@liutiming
Copy link

this will be great!

@isidorn isidorn assigned JacksonKearl and unassigned isidorn Aug 13, 2021
@isidorn isidorn added the file-explorer Explorer widget issues label Aug 13, 2021
@liomen
Copy link

liomen commented Dec 20, 2021

need this feature

@pierpuce
Copy link

This is definitely needed to me as well! Are there updates?

@egshkim
Copy link

egshkim commented Jan 12, 2024

Guys, I resolved this problem. Opening vs code with Administrator privilege, dragging files is blocked. hope it helpful for you.

@CN-tan
Copy link

CN-tan commented Jul 16, 2024

Any progress on this? Dnd from remote to local only to got a .inetloc file. Really need this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality file-explorer Explorer widget issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.