Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Code replaces my opened tabs when opening file from Finder

I'm using Visual Studio Code v1.21.1 on macOS Sierra.

I have a workspace with about 9 or 10 tabs with the files that I used all the time. But if I want to open a new file associated with VSC by double clicking it on Finder, instead of just opening it in my current instance as a new tab, it closes the instance (with all the other 10 files) and opens alone.

I can't find any setting that changes this behavior to what other editors do, and which is basically opening a file from the operating system's Finder in a new tab, whilst keeping all my other stuff opened.

like image 785
nbloqs Avatar asked Apr 09 '18 20:04

nbloqs


People also ask

How do you keep tabs open in VS Code?

Opening multiple tabs in VS Code is very straightforward. Double-click each entry from the Explorer list. However, to lock the tabs in place and prevent the single-click function from closing them, make sure that you double-click each one.


1 Answers

This happens because of preview mode in VsCode which opens the file as a preview (the file opened as a preview will have italic file name), you have to pin the preview by editing or douple clicking the tab.

you can also disable the preview mode from the setting screen under workbench.editor.enablePreview

you can find detailed explanation here https://www.brcline.com/blog/force-vscode-open-files-new-tab

like image 155
Ahmed Osama Avatar answered Dec 20 '22 06:12

Ahmed Osama