There's an action called workbench.action.closePanel
that does exactly what you'd think it does; it closes the panel in VSCode if it's open, and if it's not open it does nothing. As far as I can tell, there is no equivalent for the sidebar in VSCode (workbench.action.closeSidebar
doesn't work).
I don't want to use the workbench.action.toggleSidebarVisibility
command; I want to have an explicit "close" command for the sidebar. Is there such a command and I'm just not seeing it? If it doesn't exist, I guess I'll open a feature request.