Repository: vscode
Issue: Some Mac keyboard shortcuts does not work in the new Terminal Editor after being moved with `workbench.action.moveEditorTo<Side>Group` until the terminal editor has been unfocused and focused again
Labels: bug,help wanted,terminal-editors

<!-- ⚠️⚠️ Do Not Delete This! bug_report_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- 🕮 Read our guide about submitting issues: https://github.com/microsoft/vscode/wiki/Submitting-Bugs-and-Suggestions -->
<!-- 🔎 Search existing issues to avoid creating duplicates. -->
<!-- 🧪 Test using the latest Insiders build to see if your issue has already been fixed: https://code.visualstudio.com/insiders/ -->
<!-- 💡 Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. -->
<!-- 🔧 Launch with `code --disable-extensions` to check. -->
Does this issue occur when all extensions are disabled?: Yes

<!-- 🪓 If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. -->
<!-- 📣 Issues caused by an extension need to be reported directly to the extension publisher. The 'Help > Report Issue' dialog can assist with this. -->
```
Version: 1.78.2
Commit: b3e4e68a0bc097f0ae7907b217c1119af9e03435
Date: 2023-05-10T15:00:40.428Z
Electron: 22.5.2
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Darwin arm64 22.4.0
Sandboxed: No
```

Steps to Reproduce:

1. <details>
     <summary>Use <code>keybindings.json</code></summary>

   ```jsonc
   [
   	// #region Move between panes
   	{ "key": "cmd+alt+up", "command": "workbench.action.navigateUp" },
   	{ "key": "cmd+alt+right", "command": "workbench.action.navigateRight" },
   	{ "key": "cmd+alt+down", "command": "workbench.action.navigateDown" },
   	{ "key": "cmd+alt+left", "command": "workbench.action.navigateLeft" },
   	// #endregion
   
   	// #region Spawn terminal
   	{
   		// spawn terminal in current editor group, replace text editor if untitled and unedited.
   		"key": "cmd+alt+t",
   		"when": "editorTextFocus && resourceScheme == untitled && !activeEditorIsDirty",
   		"command": "runCommands",
   		"args": {
   			"commands": [
   				"workbench.action.createTerminalEditor",
   				"workbench.action.closeActiveEditor"
   			]
   		}
   	},
   	{
   		// spawn terminal in current editor group, replace text editor if untitled and unedited.
   		"key": "cmd+alt+t",
   		"when": "resourceScheme != untitled",
   		"command": "workbench.action.createTerminalEditor"
   	},
   	// #endregion
   
   	// #region Create new pane with untitled file (CTRL + SHIFT + OPT + CMD + <direction>)
   	{
   		"key": "ctrl+shift+alt+cmd+up",
   		"when": "editorTextFocus || terminalEditorFocus",
   		"command": "runCommands",
   		"args": {
   			"commands": [
   				"workbench.action.newGroupAbove",
   				"workbench.action.previousEditor",
   				"workbench.action.moveEditorToAboveGroup"
   			]
   		}
   	},
   	{
   		"key": "ctrl+shift+alt+cmd+right",
   		"when": "editorTextFocus || terminalEditorFocus",
   		"command": "runCommands",
   		"args": {
   			"commands": [
   				"workbench.action.newGroupRight",
   				"workbench.action.previousEditor",
   				"workbench.action.moveEditorToRightGroup"
   			]
   		}
   	},
   	{
   		"key": "ctrl+shift+alt+cmd+down",
   		"when": "editorTextFocus || terminalEditorFocus",
   		"command": "runCommands",
   		"args": {
   			"commands": [
   				"workbench.action.newGroupBelow",
   				"workbench.action.previousEditor",
   				"workbench.action.moveEditorToBelowGroup"
   			]
   		}
   	},
   	{
   		"key": "ctrl+shift+alt+cmd+left",
   		"when": "editorTextFocus || terminalEditorFocus",
   		"command": "runCommands",
   		"args": {
   			"commands": [
   				"workbench.action.newGroupLeft",
   				"workbench.action.previousEditor",
   				"workbench.action.moveEditorToLeftGroup"
   			]
   		}
   	},
   	// endregion
   
   	// #region Move current editor to pane (CTRL + SHIFT + CMD + <direction>)
   	{
   		"key": "ctrl+shift+cmd+up",
   		"when": "editorTextFocus || terminalEditorFocus",
   		"command": "workbench.action.moveEditorToAboveGroup"
   	},
   	{
   		"key": "ctrl+shift+cmd+right",
   		"when": "editorTextFocus || terminalEditorFocus",
   		"command": "workbench.action.moveEditorToRightGroup"
   	},
   	{
   		"key": "ctrl+shift+cmd+down",
   		"when": "editorTextFocus || terminalEditorFocus",
   		"command": "workbench.action.moveEditorToBelowGroup"
   	},
   	{
   		"key": "ctrl+shift+cmd+left",
   		"when": "editorTextFocus || terminalEditorFocus",
   		"command": "workbench.action.moveEditorToLeftGroup"
   	}
   	// #endregion
   ]
   ```

   </details>
3. Open terminal by using keybind from config, `OPTION` + `COMMAND` + `T`.
4. Open one more terminal.
5. Test that keybinds such as `COMMAND` + `BACKSPACE` works to remove text from cursor to beginning of line.
6. Move the terminal to a new editor group by using keybind from config, `SHIFT` + `CONTROL` + `COMMAND` + `<SIDE>`.
7. Keybinds such as `COMMAND` + `BACKSPACE` no longer works.
8. Unfocus the moved terminal and go the other terminal.
9. Go back to the moved terminal.
10. Keybinds such as `COMMAND` + `BACKSPACE` should now work again.

See video (it displays keypresses)

https://github.com/microsoft/vscode/assets/125522276/377851a8-2633-4736-bae4-c4accf656b93