Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 12, 2025

The "Create New Terminal in Editor Area" command opens terminals in the main window even when invoked from an auxiliary/floating window. The "Create New Terminal in Editor Area to the Side" command correctly respects the focused window.

Changes

Changed CreateTerminalEditor command to use ACTIVE_GROUP view column instead of bare TerminalLocation.Editor:

// Before
const options = isCreateTerminalOptions(args) ? args : { location: TerminalLocation.Editor };

// After  
const options = isCreateTerminalOptions(args) ? args : { location: { viewColumn: ACTIVE_GROUP } };

This leverages existing auxiliary window handling in _getEditorOptions (terminalService.ts:1205-1207) that resolves ACTIVE_GROUP to the actual active group ID in auxiliary windows, matching the pattern used by CreateTerminalEditorSide.

Original prompt

This section details on the original issue you should resolve

<issue_title>"Create New Terminal In Editor Area" command does not respect window in focus</issue_title>
<issue_description>Type: Bug

Steps to reproduce:

  1. Open VS Code in any workspace
  2. Open any text file to edit
  3. Run command: Create New Terminal in Editor Area
  4. Run command: Move Editor into New Window (<-- This is the new floating window)
  5. While the floating window is in focus, run command: Create New Terminal in Editor Area

Current behavior

The new terminal opens in the main window

Expected behavior

The new terminal opens in the window that is in focus when the command is run

The reason I think this is a bug and not a feature request is becuse if the "Create New Terminal in the Editor Area to the Side" command is run instead, it respects the window that is in focus.

Thank you for an awesome product! 🥂

VS Code version: Code 1.85.1 (0ee08df, 2023-12-13T09:48:16.874Z)
OS version: Darwin arm64 23.2.0
Modes:

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: meganrogge <29464607+meganrogge@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix terminal creation to respect focused window Fix "Create New Terminal in Editor Area" to respect focused window Dec 12, 2025
Copilot AI requested a review from meganrogge December 12, 2025 18:41
Copy link
Contributor

@meganrogge meganrogge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works!

@meganrogge meganrogge marked this pull request as ready for review December 12, 2025 18:53
Copilot AI review requested due to automatic review settings December 12, 2025 18:53
@vs-code-engineering vs-code-engineering bot added this to the December / January 2026 milestone Dec 12, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the "Create New Terminal in Editor Area" command to respect the focused window (main or auxiliary/floating) when creating a new terminal. Previously, the command would always create the terminal in the main window, even when invoked from an auxiliary window.

Key Changes:

  • Updated CreateTerminalEditor command to use { viewColumn: ACTIVE_GROUP } instead of bare TerminalLocation.Editor
  • Added ACTIVE_GROUP import from editor service

How It Works:
The fix leverages existing auxiliary window handling in _getEditorOptions() (terminalService.ts:1205-1207) that resolves ACTIVE_GROUP to the actual active group ID in auxiliary windows, matching the pattern already used successfully by the CreateTerminalEditorSide command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Create New Terminal In Editor Area" command does not respect window in focus

3 participants