Vscode: Explorer: Provide a setting so that only double click opens a file in the editor or expands a folder

Created on 16 Jul 2016  ·  87Comments  ·  Source: microsoft/vscode

Feature , double click to open a file.
Is it possible to add feature in order to force vscode to open file only by double clicking on it, single click should only select a file in explorer ?
This can be very useful when there is a lot of files and you looking the exact one in explorer.

debt feature-request file-explorer on-testplan tree

Most helpful comment

Added workbench.list.openMode: singleClick | doubleClick.

All 87 comments

I'm using VS Code 1.4.0 Insider, but I think v1.3.1 behaves the same way: single-click just to select and preview the file; double-click already open it.

@brunnopleffken thnx, but i want to disable preview , otherwise there is no reason for double click

@qwert789 The 'preview' function does not keep the file open when you preview or open another file in the same editor stack (unless you edit the previewed file, which makes the file opened).

Not sure what you are going for here, why would you actually (left-)click the file if you do not intend to do anything with it?

I also am trying to figure out how to do this

Why? because I want the explorer panel to have focus, I might then use the arrow keys to scroll up and down in the list of files for me. I realize the pane takes focus on mouse-enter, which honestly, is a bit weird to me.

Why else? I was hoping I could type the name of a file and it's scroll to the next file it found starting with that letter. Unfortunately, even with KB focus in the explorer window it doesn't do this.

Why else? I don't like it adding files to the "OPEN EDITORS" group while I'm still selecting/scrolling for the file I want. I want [enter] or [double click] to open the file. With preview disabled, it should still require double click to open the file (imo) -- this is how it worked in vs 2012-2013

I'm also having this trouble. Most of the time I want to drag and drop files into the editor from the explorer bar. As soon I select a file to drag, it opens it in preview mode and I lose the focus of the current editing file in editor.

Yes. I really dislike this "feature" of VS Code. I want to disable automatic previewing of any file just because I have single-clicked it. I would much rather double-click to open only. How do we achieve this?

I hate the "Preview Tab" feature of the full Visual Studio and I hate it in VSCode too.

Has anyone found a way to turn this off yet?

I found a really klunky workaround - if you right-click the Explorer pane and then hit Esc to hide the menu, the Explorer pane retains focus and then you can use the keyboard to navigate your folder.

@waynebloss You can also use the shortcut (Ctrl+Shift+E) to switch focus to explorer, or if you really want to use the mouse, you can middle-click and prevent the right-click menu that way.

@bgse when I tried that earlier today it opened the file that received focus in the explorer tree immediately.

This preview feature indeed is super annoying. Please provide a way to disable it or some guidance on how to change it manually in the code.

nthing the calls for this. i single click to get into the explorer tree to use my mouse wheel to scroll up or down or to make a particular file highlighted. i dont want it to do anything, i dont want to flash another window i just want to scroll up or down without losing where i am in my file. normally do this a lot when triple checking paths etc and its nice to just have the file highlighted.

@bgse i don't like the comment "Not sure what you are going for here, why would you actually (left-)click the file if you do not intend to do anything with it?". i might do it because i missclicked it. i might do it because i want to rename it, i might do it because im drunk and wanted to do something else, thats not really the point. the point is i am doing it and expect a result thats different to the one im getting.

it just doesn't feel really windowsy, and the single click open thing seems to use my years and years of muscle memory against me. its like someone moved my cheese. a setting that is opt in seems a nice balance to move my cheese back.

@sp4ceman No offense meant, guess coming from different platforms makes for different habits and expectations.

As for clicking the explorer tree for scroll wheel usage, you don't actually have to do that, it is sufficient to just hover the cursor over the explorer tree, and then you can start using the wheel without clicking first.

Maybe there is some hacky-whacky way to get rid of preview mode via extension for now, might look into it a bit over the weekend.

@bgse but for me the issue is that I like to pgup/pgdown in a file tree to quickly look in other folders. My projects have many files and many folders maintained by many other devs, so it is not infrequent that I don't know yet what I'm looking for. Or to use the left arrow key to close the collapse the current folder, and down/up arrow to adjacent folders and right arrow to open one and look again. Scrolling with the mouse can be somewhat slow when I'm trying to view a large range.

I've just updated to the latest version 1.8.1 this morning, and it seems that microsoft are not determined this additional option. I am really disappointed, I really hate the preview feature horribly. I have to consider switching to another ide

Updated the summary: such a setting should also control that a folder only expands on double click.

@qwert789 and other interested people: i'm working on a pull request to implement this feature. Do you expect this behaviour (single click to highlight, double click to open/toggle) everywhere else like search results, git changes, extensions, etc? Or you just want it for the explorer?

Wow, that's a great news. IMO it should be only implemented in the explorer.

@finalclass to be clear, in explorer section, there are "Open Editors" pane and "Explorer" pane. I assume you are only referring to "Explorer" pane?

I'll wait 1-2 days to see any other opinion

I don't use "Open Editors" at all, I keep it closed all the time so I can't say how it should work there.

I think the behavior should be the same in all panes of the explorer section, "open editors" and "explorer". to me this is a change in behavior of clicking on the filenames, and it shouldn't differ just because i clicked on a filename a few nodes higher in the same "viewport". Either way, this change is a welcome update and I appreciate your work on this for us. Thank you!

IMO I would expect this behaviour everywhere else as well, not just the explorer, so that it behaves consistently.

Awesome news, I believe that explorer pane is the most important place, but it would be really nice to add this behavior in all places for consistency.
Thanks man :)

@benedictleejh i hate typos the reverse meaning, but it appears you understood my intent perfectly, I typoed "should differ" where it should have said "shoudn't differ" (and i've since edited away said typo), basically, let's make it consistent. I think that's what you read from my comment, thankfully.

seem like most people agree on making it consistent and applying this behaviour to all other places

if so, here are the places that I can think of to modify, let me know if I miss out any place ( @bpasero ):

  1. Explorer tab - Open Editors pane
  2. Explorer tab - Explorer pane
    vscode - explorer

  3. Search tab - Search result pane
    vscode - search result

  4. Git tab - Changes pane
    vscode - git

  5. Debugger tab - Variables pane

  6. Debugger tab - Watch pane
  7. Debugger tab - Callstack pane
  8. Debugger tab - Breakpoint pane
    vscode - debugger

  9. Extensions tab
    vscode - extensions

  10. Find All References result
    vscode - find reference results

  11. Problems view
    vscode - problem view

@hpcsc there is also the "Problems" view where this applies.

+1 for changing this everywhere. Please also keep in mind that I think collapse/expand should only work on double click.

The easiest to find all places where a tree is used might be to just check for references to the Tree widget everywhere.

@bpasero
I updated with 2 more places:

  1. Find All References result
  2. Problems view

Do you mean collapse/expand should apply in all cases, doesn't matter the openOnSelect setting is on or off?

I have found most of places, however still have some doubts. Will post the question in the pull request. Thanks for your help

My feeling is that this setting should be named in a way that it makes more clear what it does: when enabled, a single click on a tree node is doing only selection, but neither open nor expand/collapse. Only a double click invokes the default action on a tree node (which is toggle expand/collapse for a node with children and opening otherwise).

Btw interesting to see and learn how e.g. Eclipse does it:

image

N30

On Jan 5, 2017 10:40 PM, "Benjamin Pasero" notifications@github.com wrote:

Btw interesting to see and learn how e.g. Eclipse does it:

[image: image]
https://cloud.githubusercontent.com/assets/900690/21709680/4bf45c28-d3e3-11e6-9463-d577e9e0131c.png


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/Microsoft/vscode/issues/9388#issuecomment-270842371,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AXjFUBb09LzYd2r6j9UuKckAK7UblLYVks5rPeHJgaJpZM4JOBpq
.

@bpasero Good idea, I can rename it to workbench.openMode with 2 values: singleClick or doubleClick
I put it under workbench since now it's applicable to everywhere, not just the sidebar

Sounds good.

Any news on this irritating single click preview mode?

Sorry, didn't have much time to look into this again. As it stands right now we need to clean up some debt first in the area of tree usage throughout our code before we can ask for a PR again.

There are many reasons for this - I don't mentioned it so much because I accepted it - but good this issue exists.
If I just want to "select" a folder to execute an action on it (currently it toggle the folder also this is annoying)
If you just want to "select" a file to execute an action it it (currently it opens a preview, this is irritates)

As alternative, a little bit hidden solution, I just want to mention that it could differ where you click the filesystem entry. For example if clicking the icon or the space before it could be just a select, if click the file name or the space after it it stays with the current behaviour. Of course this would be the best of both worlds but I understand if you are not ready for experiments like this.

Any news on this? I would like it.
Its one of the only things keeping me with IntelliJ

???

On 8/16/17, Ricky Rage rickyrage1337@gmail.com wrote:

On 8/10/17, Shayne Hartford notifications@github.com wrote:

Any news on this? I would like it

--
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
https://github.com/Microsoft/vscode/issues/9388#issuecomment-321545438

waiting for this.

yeah, me too. The way clicking works on explorer now is just too annoying and overshadows the goodies that are included in vscode.

That doesn't fix this, that makes it so when you single click on a file it doesn't open as a temporary file, but as a permanent file, it does not change the single click to open to a double click.

@ShayBox I agree. This was unexpected behavior when I first opened the editor. I was surprised that I couldn't find a setting to disable the single click. 😞

there is no way to disable single click preview. it is very annoying.

Oh man... this thing is really annoying!!!! Please just include some new property where a developer can disable/enable it

Annoying as hell indeed.

Annoying indeed, let's add an option in preferences.

The single-click folder expand/collapse is the most annoying thing about VS Code, which is otherwise a brilliant editor. Please add an option in the preferences for this.

"workbench.editor.enablePreview": false,
"workbench.editor.enablePreviewFromQuickOpen": false
这两个设置并不能解决问题,浪费了老子好长时间

              __
            //_/| 
           /—-/ 
          /—-/ 
         /—-/ 
        /—-/ 
       /—-/ 
    /´¯/'--'/´¯`·_ 
  /'/--/—-/—--/¨\ 
 ('(———- ¯~/'--') 
  \————-'—--/ 
  '\'————_-·´
    \———--  /
     \———--

In Case you misunderstood the above comment like I did, it is actually giving a middle finger to the fact that the above options doesn't fix the problem.
"These two settings do not solve the problem, wasting my mother for a long time" - Google translate

It doesn't change the fact that his comment is worthless, like most of others who just bump the thread for no reason - by repeating something that have already been said.
Please, use Reactions - add +1 on the main post, and move on if you don't have anything relevant to say.

Any news?
Please provider a "double click" model.

i want to doubleclick to open ... please make it so !

Doubleclick for file opening +1

Doubleclick for file opening +1
👎 1

Any news?
Please provider a "double click to open file" model. I expected the annual year that this feature is not yet appearing

Doubleclick for file opening +1

The single-click preview makes bad the best editor around

Doubleclick for file opening and folder expand !

I find this very annoying myself too! I'm wanted to use VS for my new projects, but this 'feature' makes me hate it instead..

Same here, pretty annoying lack of feature ...

UGH. Happy New Year and another year of single clicking.

I use a Wacom pen with one button set to double click and I'm so used to doing this in Visual Studio that now I'm working with VSCode I end up opening and closing a folder instead of opening it. Super annoying when switching between IDEs. With single click it just feels much more 'fragile' somehow - like I'm going to break it. I know that doesn't make total sense but it's how it feels.

Please create a setting for this. How can so much be configurable in VSCode, yet this simple setting does not exist? There is no reason for it. If a developer prefers to single-click or double-click, so be it. Neither option should be forced across the board, especially for as configurable as VSCode is.
Disclaimer: VSCode is still amazing. :)

Is there any extension to fix this problem? I'm unable to find anything as this far.

I hate VS Code PreView....
I don't want this fucking PreView!!!! I want to double-click to open a new tab..............
DO NOT copy the style from Sublime, Atom or any else..................

I can't understand why you would want to click on a file if you don't want to actually do something with it?

Now, for those that really has this slight behavior disability (which seems like quite alot of people reading this thread) I do agree that there could be an option for this.

@ponylin1985 @fractalf
Why? Mainly to focus the file. When in windows explorer or mac's finder you click on a file it does not automatically open but it just focuses it. In VSCode it automatically opens in a weird preview state. Then when it's opened in this preview state and you will not notice that and click on another file to open another file then your first file will automatically close because it has been in this preview state. I'm using VSCode for more then a year now and this single issue is still driving me crazy. It's the most annoying thing of VSCode and I can't get use to it no matter how I try. Judging on the number of comments in this topic I see that I'm not alone.
I understand why someone would like it to work as it is right now thus I think this should be an option. Even better solution would be to provide the ability to write custom plugins that would replace Explorer completely.

VSCode team please give an update on this feature. Will you ever plan to solve it? It has been reported 1.5 years ago and there is still no update on this one;(

@fractalf i cant scroll the explorer up and down without activating the window. i cant activate the window without clicking on something. normally the something in a file explorer is a file so thats what normally gets clicked on. this is normal windows behaviour.

previewing what i just clicked on is not normal windows behaviour. nothing in windows behaves this way its non standard and in a year of daily usage of vscode it still feels weird.

Well, I discovered that the event listener for the explorer is located in TreeView.ts, which is located on the cloud, not local.

The question is:
Is it possible to override the event by writing an extension?

It's a bloody annoying feature for sure. workbench.editor.enablePreview --> false at least gets rid of the preview feature.

It still opens the file (not as a preview) on its own tab, which is better, but I'd definitely like the option to double click instead so that it matches all my other editors.

I'm finding the default of, "Click a file to preview" and "Click a folder to collapse/expand" really tiring for the very simple operation of copying and pasting files. I click the file I want to copy, it opens in preview, I click the folder I want to paste it in and the overeager expand/collapse functionality makes me second guess where I am pasting the file.

There is an arrow to indicate that a folder is collapsed or expanded. I would expect that clicking the title simply gave the folder focus. I would expect to click the arrow to expand or collapse the folder.

Sidebar:
I would actually like to cut and paste files to move them, something that seems supported in most IDEs. But I can't "cut" a file.

@StanleyGoldman You can move files and folders with drag&drop.

@montapro copy paste is more user friendly since sometimes you have a lot of files and directories expanded and you have to scroll a lot to drop a dragged file.

@finalclass It also my opinion. But it's a way.

Yes, @montapro I think we all realize drag and drop is supported 😅, but it seems every other IDE I use (ahem... like Visual Studio) has gotten me used to such functionality.

Added workbench.list.openMode: singleClick | doubleClick.

@bpasero Commit, Release, Ship it !

💪

That's music to my ears!!! Oops, I mean, a collyrium to my eyes!!! xD Looking forward to it! Big thanks @bpasero

Can I hear a big halleluiah from my bros and sistas?

Thanks

Finally! Thank you! When it will be released?

@pohybel

bpasero (Benjamin Pasero) added this to the January 2018 milestone 5 hours ago

thank you!

This will be in todays insider build to try out. You can give our preview releases a try from: https://code.visualstudio.com/insiders/

@bpasero Just tried it out in the insiders build. While it works great, there is an usability issue.

The tree in the explorer must be expandable in single click and the file should be opened by double click. Right now, we need to double click even for opening tree in the explorer which is not user friendly. I am using my keyboards arrow key for opening up trees now due to this.

If both configs could be separated, it would be great. I would prefer to expand tree on single click and open on double click (hope it makes sense). That is how Atom and most of the editors behave.

Love the great work you guys are doing for vscode. Keep it up.

code

@tvvignesh that would be inconsistent with vscode itself as well as all other apps with a tree view that work the same way. The little triangle is there for single click operations.

"Most editors" certainly not intelliJ, windows explorer, nautilus etc.

I agree on the desire to expand a tree node with single-click if clicking onto the twistie, for that I opened: https://github.com/Microsoft/vscode/issues/42621

I am not sure about adding 2 options for expanding/collapsing a node with children and opening an item, for me logically it is the same "open" operation.

I agree with @luispabon.
Even in Visual Studio you have to double-click a folder to expand/collapse in the tree view. But you can click on the little triangle icon to expand/collapse with a single click. Maybe thats an option, @bpasero?

I tried clicking on triangle. Did not work. Had to double click to get it to expand. Also, the triangle is too small. Please check atom. Looking for the same functionality..

Single click to select or expand, double click to open. I tried opening the same project in both vscode and atom, tried expanding and I could clearly see the change in usability. Just my feedback here. Not sure how vscode internals are.

@bpasero: looks like you are already working on it. Thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chrisdias picture chrisdias  ·  3Comments

v-pavanp picture v-pavanp  ·  3Comments

villiv picture villiv  ·  3Comments

shanalikhan picture shanalikhan  ·  3Comments

DovydasNavickas picture DovydasNavickas  ·  3Comments