Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSCode - how to close the search result sidebar panel?

I disabled the activity bar (the leftmost panel with shortcuts buttons).

When I search for something the search results shown in side bar, replacing the file explorer. When I'm done with the search - how can I close the search results and see the file explorer bar again?

Given that there's no activity bar with the file structure bar shortcut on it? I tried clicking escape but the file results won't disappear. There's not even a button to close it.

like image 528
Alex Craft Avatar asked Jan 08 '19 05:01

Alex Craft


People also ask

How do I close the Search bar in Vscode?

Press CTRL + SHIFT + E.


3 Answers

I assume that you see something like this when you realize a search:

Search sidebar Visual Studio Code

You can go back to the Explorer sidebar on two different ways:

  1. Press in the File icon that is up of the Search icon
  2. Use the Ctrl+Shift+E shortcut
like image 56
Inazense Avatar answered Jan 03 '23 17:01

Inazense


After pulling up search with Cmd+Shift+F, I'm able to close with Cmd+B on Mac.

like image 41
Alexander Terry Avatar answered Jan 03 '23 19:01

Alexander Terry


This is a frustrating takeover of screen real-estate!

The UI for VSCode's search results pane aren't fully like a modal and they're not quite like a vertical tab. If you hover over the icons in the left-hand margin, you'll see the keyboard shortcuts for the "Explorer" and for "Search". On a Mac, it's Command + 1 to toggle the explorer and Command + 3 to toggle the search results.

However, toggling the explorer may not leave your screen the way it was before the search, so this isn't really the clean solution many of us were hoping for.

Here's a related question/answer with instructions for creating a key-binding.

The closest I have been able to come to the "expected behavior" I desire is to add the following rule to the top of my keybindings.json:

{
  "key": "Escape",
  "command": "workbench.view.explorer",
  "when": "searchViewletVisible"
}

The when clause helps scope its effect, but it may conflict with other commands.

like image 20
Everett Avatar answered Jan 03 '23 17:01

Everett