I want to make a shortcut that changes the terminal’s position, from left to right and vice-versa. I managed to accomplish this with 2 different shortcuts, but I want to use only one shortcut.
{
"key": "ctrl+shift+i",
"command": "runCommands",
"args": {
"commands": [
"workbench.action.positionPanelLeft",
"workbench.action.terminal.focus"
]
},
"when": "terminalPosition == /right/ && terminalFocus"
},
{
"key": "ctrl+shift+i",
"command": "runCommands",
"args": {
"commands": [
"workbench.action.positionPanelRight",
"workbench.action.terminal.focus"
]
},
"when": "terminalPosition == /left/ && terminalFocus"
},
I found that to have multiple commands assigned to the same shortcut, every command needs to have a different “when” clause. From my perspective the “when” clause is different in both commands.
When I tested every command with a different key all worked fine, but when the key is the same only the second shortcut is working.
I tried to change the key to exclude the possibility of another command conflicting with these 2, and the problem persisted.
user25937242 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.