Frank Vu
Frank Vu

Reputation: 1363

How to delete recent opened file session on Visual Studio Code?

I opened few files during coding (both files in project and out project). After that, I close few in its (by ctrl+w and click the 'x' button). When type ctrl+tab, I always see all opened files.

I try to restart VSCode, restart Windows but nothing change.

How do I close unnecessary files?

I use VS Code 1.0 + Windows 10.

Upvotes: 77

Views: 60723

Answers (7)

arjuns
arjuns

Reputation: 399

View > Command Palette... (Cmd + Shift + P) > Clear Editor History

Upvotes: 22

user7967189
user7967189

Reputation: 83

just click "more" in below the recent list in the welcome page. Then click "x" in the list. Refer to this image

Upvotes: 6

ali sampson
ali sampson

Reputation: 467

To clear recently opened sessions in VS code, please do the following:

  1. Press Ctrl + Shift + P(on Windows) or Cmd + shift + P(on MAC)
  2. In the Quick Open bar that shows up, type in Clear Recently Opened
  3. You can either restart VS code now or choose to continue using it.

Hope this helps. Happy coding!

Upvotes: 3

andrea
andrea

Reputation: 890

I have just found a workaround which seems to remove a single directory from recents, in case you do not wish to remove all of them.

  1. Press ctrl+shift+p (you may need command+shift+p instead if using a Mac) and select File: Open Recent...
  2. After you click on that, you should see a dropdown with your recently opened projects. Hover with the mouse on the one you want to delete and towards the end of the line you're hovering you should see a small x appearing
  3. Click on that x and you're all done

Upvotes: 13

tjkn
tjkn

Reputation: 159

For latest Visual Studio Code (1.54.2):

  1. View-Command Palette or Ctrl + Shift + P
  2. in the Command Palette dialog box: File: Clear Recently Opened
  3. Restart Visual Studio Code

Upvotes: 1

John Archer
John Archer

Reputation: 2495

If you want to clear a specific item (not the whole list) from the recently opened list you have to

  1. Press Ctrl + SHIFT + P
  2. Type Remove From History (in earlier version it is Remove From Editor History) and press Enter
  3. Choose/Find the file you want to clear

Source: link

Update 09.04.2020:

With the release of Visual Studio Code 1.44.0 you can easily remove a file using the UI. You see a closing x next to a file in this recently opened files view:

Remove a file from the recently opened files list

Upvotes: 82

klewis
klewis

Reputation: 8350

I could be mistaken but you don't want to delete, but "clear" recently opened files. If that is the case, then follow these steps in regards to VS Code version 1.15.0:

  • Press Ctrl + Shift + P
  • Then, within the Quick Open bar, type in >Clear Recently Opened
  • Press Enter, restart Visual Studio Code, and you should now see nothing under Recent.

Upvotes: 80

Related Questions