Skip to content

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 #183268

Closed

Description

Does this issue occur when all extensions are disabled?: Yes

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. Use keybindings.json
    [
    	// #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
    ]
  2. Open terminal by using keybind from config, OPTION + COMMAND + T.

  3. Open one more terminal.

  4. Test that keybinds such as COMMAND + BACKSPACE works to remove text from cursor to beginning of line.

  5. Move the terminal to a new editor group by using keybind from config, SHIFT + CONTROL + COMMAND + <SIDE>.

  6. Keybinds such as COMMAND + BACKSPACE no longer works.

  7. Unfocus the moved terminal and go the other terminal.

  8. Go back to the moved terminal.

  9. Keybinds such as COMMAND + BACKSPACE should now work again.

See video (it displays keypresses)

Screen.Recording.2023-05-24.at.00.34.29.mov

Activity

  1. Tyriar commented on May 24, 2023

    @Tyriar
    Contributor

    I believe this is already fixed, can you see if you can reproduce in the Insiders build? Let us know if not.

  2. jamesbradlee commented on May 28, 2023

    @jamesbradlee
    Author

    I'll take a look thanks!

  3. jamesbradlee commented on May 28, 2023

    @jamesbradlee
    Author

    Daniel Imms (@Tyriar) Nope, still an issue:

    Version: 1.79.0-insider (Universal)
    Commit: 2dfb838
    Date: 2023-05-26T05:24:15.292Z (2 days ago)
    Electron: 22.5.3
    Chromium: 108.0.5359.215
    Node.js: 16.17.1
    V8: 10.8.168.25-electron.0
    OS: Darwin arm64 22.4.0

  4. added
    bug
    on May 28, 2023
  5. added this to the Backlog milestone on May 28, 2023
  6. added
    help wanted
    on Dec 8, 2023
  7. nkramber commented on Oct 3, 2026

    @nkramber
    Contributor

    I'd like to work on this. It still reproduces on current main, and it isn't Mac-specific: any terminal keybinding that sends to the active terminal (Cmd+Backspace, Cmd+←/→, Ctrl+Backspace on Windows/Linux) does nothing after a terminal editor is moved to another group.

    Cause. Moving an editor opens it in the target group and then closes it in the source group with EditorCloseContext.MOVE. TerminalEditorService's onDidCloseEditor handler treats that as a real close: it removes the terminal from instances and clears the active instance (

    // Remove the terminal from the managed instances when the editor closes. This fires when
    // dragging and dropping to another editor or closing the editor via cmd/ctrl+w.
    this._register(this._editorService.onDidCloseEditor(e => {
    const instance = e.editor instanceof TerminalEditorInput ? e.editor.terminalInstance : undefined;
    if (instance) {
    const instanceIndex = this.instances.findIndex(e => e === instance);
    if (instanceIndex !== -1) {
    const wasActiveInstance = this.instances[instanceIndex] === this.activeInstance;
    this._removeInstance(instance);
    if (wasActiveInstance) {
    this.setActiveInstance(undefined);
    }
    }
    }
    }));
    ). When the moved terminal is activated in its new group, setActiveInstance can't find it, so ITerminalService.activeInstance is undefined and the send-sequence command is dropped. It only recovers once onDidVisibleEditorsChange re-adds it, and that path also leaves its input mapping and focus/dispose listeners unregistered.

    Proposed fix:

    • In that handler, return early when e.context === EditorCloseContext.MOVE, since the terminal is still open in the editor area. Real closes, and moving the terminal to the panel or to a separate VS Code window (both go through detachInstance), are unchanged.
    • Add a TerminalEditorService unit test: a MOVE close keeps the terminal tracked and active, and a normal close still removes it.

    Megan Rogge (@meganrogge) does that approach work for you? I'll open a PR unless you'd prefer something else.

  8. added
    unreleased
    on Nov 5, 2026
  9. added a commit that references this issue on Nov 5, 2026
    7e1ee06
  10. added
    insiders-released
    and removed
    unreleased
    on Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bughelp wantedinsiders-releasedterminal-editorsverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions