Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is drag-and-drop to open a file possible in VSCode?

I am wondering if something is wrong with my computer (or myself), because I can't seem to drag & drop a file into Visual Studio Code to open it in the editor. Closing an opened folder first doesn't make a difference. VSCode always shows me the 'stop sign', in every spot I tried (the editor, the opened tab bar, an existing opened file, ...).

Why does VSCode block this ?

(I have experienced this in earlier versions as well. Currently on v1.6 on Windows 7.)

like image 471
pleinolijf Avatar asked Oct 12 '16 11:10

pleinolijf


People also ask

How do you drag and drop files in VS Code?

Open VSCode. Open an Explorer Window. Try to drag and drop a file into the editor window. A "no drop" cursor appears.

How do I quick open files in VS Code?

Quick file navigation# Tip: You can open any file by its name when you type Ctrl+P (Quick Open).

How do you drag code in VS Code?

Select your 4 values below and cut ( CTRL + X ), then place your cursor to the right of your first line comma, hold down CTRL + ALT then press down on the arrow key 4 times to multi-select your target lines. Then press CTRL + V to paste the values.


2 Answers

Searching for a solution, I stumbled on this page, where one commenter explains:

I think you are running into the security issue where lower permission processes cannot send messages to higher permission processes. Explorere.exe, running at normal permission levels, cannot send the window message to winword.exe, running elevated.

I am indeed always running VSCode as Administrator, but not my Explorer windows.

When I run VSCode in non-administrator mode (so just my regular user), drag-and-drop works fine.

like image 97
pleinolijf Avatar answered Dec 07 '22 04:12

pleinolijf


I feel silly as I lost 15 minutes looking into this. In case it helps:

Make sure you are not trying to open files from a zip file...

Cheers.

like image 44
DHLopez Avatar answered Dec 07 '22 02:12

DHLopez