This feature is toggled with the command “View: Toggle Tab Visibility”.
Internally, it is known as workbench.action.toggleTabsVisibility.
On MacOS, the default keybinding is command + control + w, which is dangerously close to the OS’s "Lock Screen" command command + control + q. (Hitting this accidentally while trying to lock my screen is how I got here!)
On Linux, the default keybinding is meta + control + w
On Windows, the keybinding used to be win + control + w, but it looks like they removed it. See these github issues:
This is a "feature" albeit a confusing one of Visual Studio code called the "Preview" tab!
I know I struggled with it until I took the time out and searched here for an answer!.
Normally you can single-click on a file and open it in a preview tab, go over it and move on to the next one. This can be handy when you've opened a folder and quickly want to go through the files therein.
However, it is confusing when you're actually working on files. The simplest solution is to double-click on a file in the explorer tab, this opens up the file in it's own separate tab.
IMHO, an alternate approach to disabling the feature, is getting used to this "default" setting of a preview tab, rather than turning it off in settings and later on, when you re-install it or go to another machine, struggling with "Ahh...I knew I did something to disable this behaviour!".
If this thought process doesn't work for you, you can always do what's suggested in the other answers.
As of the most recent update, in my VSC, you have to double-click the file icon to get a new tab.
And this just when I was finally getting used to clicking ONCE in the older version. I mean, I get "push out a new feature set ASAP" if Microsoft wants to compete with F/OSS, but haven't they heard of POLA ... and not breaking it?
try command + ctrl + w in Mac, it works fine
This feature is toggled with the command “View: Toggle Tab Visibility”. Internally, it is known as
workbench.action.toggleTabsVisibility
.On MacOS, the default keybinding is
command + control + w
, which is dangerously close to the OS’s "Lock Screen" commandcommand + control + q
. (Hitting this accidentally while trying to lock my screen is how I got here!)On Linux, the default keybinding is
meta + control + w
On Windows, the keybinding used to be
win + control + w
, but it looks like they removed it. See these github issues:This is a "feature" albeit a confusing one of Visual Studio code called the "Preview" tab!
I know I struggled with it until I took the time out and searched here for an answer!.
Normally you can single-click on a file and open it in a preview tab, go over it and move on to the next one. This can be handy when you've opened a folder and quickly want to go through the files therein.
However, it is confusing when you're actually working on files. The simplest solution is to double-click on a file in the explorer tab, this opens up the file in it's own separate tab.
IMHO, an alternate approach to disabling the feature, is getting used to this "default" setting of a preview tab, rather than turning it off in settings and later on, when you re-install it or go to another machine, struggling with "Ahh...I knew I did something to disable this behaviour!".
If this thought process doesn't work for you, you can always do what's suggested in the other answers.
On a mac, if both of the existing answers didn't work, you can try command + ctrl + w, worked for me.
As of the most recent update, in my VSC, you have to double-click the file icon to get a new tab.
And this just when I was finally getting used to clicking ONCE in the older version. I mean, I get "push out a new feature set ASAP" if Microsoft wants to compete with F/OSS, but haven't they heard of POLA ... and not breaking it?
I had the same problem and I just changed the following settings inside visual studio 2017.
visual studio 2017 view