VSCode showing only one file in the tab bar (can't open multiple files)

Visual Studio-Code

Visual Studio-Code Problem Overview


I hit some shortcut and I can't find the setting the turn it off. But opening multiple files doesn't show different tabs.

Here's what I'm seeing

enter image description here

But this is what I'm expecting when I open a new tab

enter image description here

Visual Studio-Code Solutions


Solution 1 - Visual Studio-Code

Check User interface / Tabs. You just need to add the following line in the configuration file.

"workbench.editor.showTabs": false

I also think that https://stackoverflow.com/questions/38147154/how-to-disable-tabs-in-vscode is asking the exact opposite of what you are asking.

Solution 2 - Visual Studio-Code

On a mac, if both of the existing answers didn't work, you can try command + ctrl + w, worked for me.

Solution 3 - Visual Studio-Code

try command + ctrl + w in Mac, it works fine

Solution 4 - Visual Studio-Code

The accepted answer didn't work for me for some reason. The answer given in https://stackoverflow.com/questions/38713405/how-to-config-vscode-to-open-files-always-in-a-new-tab did.

In short: In the menu bar, click on File > Preferences > Settings. Then add the following line to the settings file.

"workbench.editor.enablePreview": false

Solution 5 - Visual Studio-Code

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:

Solution 6 - Visual Studio-Code

By mistake i tap on mac ctrl + command + w button on visual studio code then open file tabs hide.

Then i tap same button Ctrl+ Cmd + w then its again shows

Solution 7 - Visual Studio-Code

VSCode Extension: Wrap Console Log use Ctrl + Alt + W to wrap

VSCode use ^ + ⌘ + W to Toggle Tab Visiblity

VSCode use ⇧ + ⌘ + W to Close Window


It's easy to make mistakes .

Solution 8 - Visual Studio-Code

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?

Solution 9 - Visual Studio-Code

On VsCode version 1.64.2 , do the following :

  1. Open VsCode settings and search for "Show Tabs", like shown in this screen shot:enter image description here
  2. Check and select the option for "Show Tabs" as pointed.

Solution 10 - Visual Studio-Code

For mac, if your tab close icon disappears and showing every page in a new tab just press (as shown in image).

enter image description here

Command + Control + W

or

⌘ + ^ + W

It will appear your tab icons (as shown in the picture).

enter image description here

Solution 11 - Visual Studio-Code

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.

Solution 12 - Visual Studio-Code

Go to Preferences -> Settings -> UserSettings -> Workbench -> EditorManagement
check "Show Tabs" . Tabs will appear immediately .Enjoy

Solution 13 - Visual Studio-Code

Follow this,

Go to Preferences -> Settings -> UserSettings -> Workbench -> EditorManagement
check "Show Tabs"

and Restart, Enjoy (y)

Solution 14 - Visual Studio-Code

This error happens because workbench.editor.showTabs is set to false. Open the Settings.json Press cmd+Shift+p and then type Open Setting and hit Enter

In the settings.json file add this line at the bottom.

"workbench.editor.showTabs": true

Solution 15 - Visual Studio-Code

This has nothing to do with setting workbench.editor.showTabs:true.Just double click on the file you want open in new tab and it will VS Code will open it for you in new tab.

Solution 16 - Visual Studio-Code

I think it's the property "workbench.editor.showTabs": true. I had the same problem and I just changed this setting to true.

Solution 17 - Visual Studio-Code

If you still feel you have this problem it could be that "Preview Mode" is enabled. The title of the tab will be in italics, meaning it is in preview mode and the same tab will be used when you open the next file, unless you start modifying the file.

Go to settings and find "Workbench > Editor: Enable Preview" and deselect it. Now every file will be opened in a new tab.

Solution 18 - Visual Studio-Code

In latest visual studio code , by double clicking on any of the file in file explorer will open in new tab. It assumes single click as a file preview option and many people get confused with it.

Solution 19 - Visual Studio-Code

In short: double-click (Open) rather than single-click

Solution 20 - Visual Studio-Code

Try this

"workbench.editor.showTabs": true,
"workbench.editor.enablePreview": false,

Solution 21 - Visual Studio-Code

In vscode ,click on file>preferance>setting. In setting, there would be a search-bar. There, you have to search "workbench.editor.enablePreview": false. Then you will get one option with checked-box. If it is already checked then you mark it as unchecked.

Solution 22 - Visual Studio-Code

I believe this is a new feature in VS Code, When you are opening a new project and skimming through the code file by file, each file will get replaced in the same tab, Whilst if you do some changes in a file and save it, and try opening a new file it will open in a new file.

May be it is trying to do some kind of tab clean up by restricting the user to open multiple tabs and restricting them to use multiple tabs only when they need to edit the files in them.

Solution 23 - Visual Studio-Code

Goto Settings (Ctrl + ,) Type 'workbench.editor' Click Checkbox on Controls whether opened editors... your problem is solved

workbench editor in vss

Solution 24 - Visual Studio-Code

On a mac and maybe other OSs you can double click on the filename to pin the file open in the editor. This way, you can selectively choose which files you want to remain open in the VS Code editor.

Solution 25 - Visual Studio-Code

In VSCode, click Manage (is the gear shown at lower-left corner) > Settings >

in the search bar on top type "showtabs" , do below 2 changes

  1. Workbench › Editor: Show Tabs = checked

  2. Workbench › Editor: Tab Sizing = shrink

Solution 26 - Visual Studio-Code

File > Preferences > Settings

Search editor enable preview on search bar, Disable Enable Preview option (Just untick or set false).

enter image description here

enter image description here

Solution 27 - Visual Studio-Code

you need edit setting.json file,

settings.json, located at

Windows %APPDATA%\Code\User\settings.json
macOS $HOME/Library/Application Support/Code/User/settings.json
Linux $HOME/.config/Code/User/settings.json


        {
          "workbench.editor.showTabs": true,
          "workbench.editor.enablePreview": false
        }

Solution 28 - Visual Studio-Code

go to preferences > workbench > enable preview, or just open preferences and search 'preview', mark as true.

Solution 29 - Visual Studio-Code

quick fix, click on the page you want to display in another tab next to it and drag it there and it will revert back to its normal ways of opening each page as a new tab.

my reference is i did it now so i decided to sign up here hoping to make things easier for anyone having this problem.

Solution 30 - Visual Studio-Code

I had the same problem and I just changed the following settings inside visual studio 2017.

> Tools > Environment > Tabs and windows

visual studio 2017 view

Solution 31 - Visual Studio-Code

Go to keyboard shortcuts and search for covert indent to tabs-> by default there won't be any shortcut assigned to it, you have to assign it and then run the shortcut. It will be fixed.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionTolga EView Question on Stackoverflow
Solution 1 - Visual Studio-CodedstrantsView Answer on Stackoverflow
Solution 2 - Visual Studio-CodeDivyanshu KalraView Answer on Stackoverflow
Solution 3 - Visual Studio-Codeneeraj-dixit27View Answer on Stackoverflow
Solution 4 - Visual Studio-CodeReidView Answer on Stackoverflow
Solution 5 - Visual Studio-CodeNoach MagedmanView Answer on Stackoverflow
Solution 6 - Visual Studio-CodeVivek SinghView Answer on Stackoverflow
Solution 7 - Visual Studio-CodeJonView Answer on Stackoverflow
Solution 8 - Visual Studio-CodeKevin_KinseyView Answer on Stackoverflow
Solution 9 - Visual Studio-CodeAlferd NobelView Answer on Stackoverflow
Solution 10 - Visual Studio-CodeHabibView Answer on Stackoverflow
Solution 11 - Visual Studio-CodeBharat MallapurView Answer on Stackoverflow
Solution 12 - Visual Studio-Codedeva11View Answer on Stackoverflow
Solution 13 - Visual Studio-CodeSamView Answer on Stackoverflow
Solution 14 - Visual Studio-CodeVishweshwaranView Answer on Stackoverflow
Solution 15 - Visual Studio-CodeolammyView Answer on Stackoverflow
Solution 16 - Visual Studio-CodeManuel Eduardo RomeroView Answer on Stackoverflow
Solution 17 - Visual Studio-CodeHenk KrugerView Answer on Stackoverflow
Solution 18 - Visual Studio-CodeAmbuj KumarView Answer on Stackoverflow
Solution 19 - Visual Studio-CodeJob MView Answer on Stackoverflow
Solution 20 - Visual Studio-CoderickyView Answer on Stackoverflow
Solution 21 - Visual Studio-CodesureshView Answer on Stackoverflow
Solution 22 - Visual Studio-CodeAlexander Immanuel DView Answer on Stackoverflow
Solution 23 - Visual Studio-CodeSenthil RoyanView Answer on Stackoverflow
Solution 24 - Visual Studio-CodeBrianBView Answer on Stackoverflow
Solution 25 - Visual Studio-CodevikramviView Answer on Stackoverflow
Solution 26 - Visual Studio-CodeXpressGeekView Answer on Stackoverflow
Solution 27 - Visual Studio-CodehoogwView Answer on Stackoverflow
Solution 28 - Visual Studio-CodeRafael GuimarãesView Answer on Stackoverflow
Solution 29 - Visual Studio-Codenooru73View Answer on Stackoverflow
Solution 30 - Visual Studio-CodeSujayView Answer on Stackoverflow
Solution 31 - Visual Studio-CodeManish PandeyView Answer on Stackoverflow