Repository navigation
Closed
Labels
bugIssue identified by VS Code Team member as probable bughelp wantedIssues identified as good community contribution opportunitiesinsiders-releasedPatch has been released in VS Code Insidersterminal-editorsverifiedVerification succeeded
Milestone
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:
-
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 ]
-
Open terminal by using keybind from config,
OPTION+COMMAND+T. -
Open one more terminal.
-
Test that keybinds such as
COMMAND+BACKSPACEworks to remove text from cursor to beginning of line. -
Move the terminal to a new editor group by using keybind from config,
SHIFT+CONTROL+COMMAND+<SIDE>. -
Keybinds such as
COMMAND+BACKSPACEno longer works. -
Unfocus the moved terminal and go the other terminal.
-
Go back to the moved terminal.
-
Keybinds such as
COMMAND+BACKSPACEshould now work again.
See video (it displays keypresses)
Screen.Recording.2023-05-24.at.00.34.29.mov
Metadata
Metadata
Assignees
Labels
bugIssue identified by VS Code Team member as probable bughelp wantedIssues identified as good community contribution opportunitiesinsiders-releasedPatch has been released in VS Code Insidersterminal-editorsverifiedVerification succeeded
Activity
Tyriar commentedon May 24, 2023
I believe this is already fixed, can you see if you can reproduce in the Insiders build? Let us know if not.
jamesbradlee commentedon May 28, 2023
I'll take a look thanks!
jamesbradlee commentedon May 28, 2023
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
nkramber commentedon Oct 3, 2026
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'sonDidCloseEditorhandler treats that as a real close: it removes the terminal frominstancesand clears the active instance (vscode/src/vs/workbench/contrib/terminal/browser/terminalEditorService.ts
Lines 94 to 108 in 45373f0
setActiveInstancecan't find it, soITerminalService.activeInstanceisundefinedand the send-sequence command is dropped. It only recovers onceonDidVisibleEditorsChangere-adds it, and that path also leaves its input mapping and focus/dispose listeners unregistered.Proposed fix:
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 throughdetachInstance), are unchanged.TerminalEditorServiceunit 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.
Keep terminal editors working after moving them to another editor gro…