skip to Main Content

At Visual Studio Code version 1.7x.x, I assigned a keyboard shortcut to hide tabs visibility. It looks like this:

// keybindings.json

{
    "key": "ctrl+t ctrl+t",
    "command": "workbench.action.toggleTabsVisibility"
}

Then updating to 1.84.2 shows command 'workbench.action.toggleTabsVisibility' not found when I try to use the keybinding. Is it removed or is there new command for that?

2

Answers


  1. It looks like roughly last month (the 1.84.0 update) these commands were renamed (and some commands were also added) looking at the Visual Studio Code repository commit history here in commit e47adcb.

    It looks like there are some new commands you instead need to use, namely workbench.action.hideEditorTabs to hide the editor tabs, and then workbench.action.showMultipleEditorTabs to reveal them again (there is also workbench.action.showEditorTab which will show a single tab as well, but if you want to show all tabs, then you can ignore that command).

    Thus something like this in the JSON keyboard settings:

    [
        {
            "key": "ctrl+t ctrl+q",
            "command": "workbench.action.hideEditorTabs"
        },
        {
            "key": "ctrl+t ctrl+t",
            "command": "workbench.action.showEditorTabs"
        }
    ]
    
    Login or Signup to reply.
  2. If you are looking to toggle between showing a single tab and multiple tabs, try these keybindings:

    {
      "key": "ctrl+t ctrl+t",        // same keybinding as below, so it is a toggle
      "command": "workbench.action.hideEditorTabs",
      "when": "editorTabsVisible"
    },
    {
      "key": "ctrl+t ctrl+t",        // same as above
      "command": "workbench.action.showMultipleEditorTabs",
      "when": "!editorTabsVisible"
    }
    

    These use a context clause to distinguish the two states.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search