Repository navigation
Description
Problem
Spawning a builder terminal unconditionally targets vscode.ViewColumn.Two (packages/vscode/src/terminal-manager.ts:336). If the user only has one editor group open, VS Code creates a new second group to host the terminal. That's intrusive — the user's existing layout gets reshaped every time a builder spawns, even if they were happily working in a single column.
Desired behavior:
- Second group exists → spawn in it (current behavior, preserved).
- No second group exists → spawn in the first / default group instead of forcing a new one into existence.
This keeps the "builders live in the right pane" affordance for users who already work in a split, while staying out of the way for users who don't.
Current state
terminal-manager.ts:330–337:
let location: vscode.TerminalLocation | vscode.TerminalEditorLocationOptions;
if (type === 'dev' || position !== 'editor') {
location = vscode.TerminalLocation.Panel;
} else if (type === 'architect') {
location = { viewColumn: vscode.ViewColumn.One };
} else {
location = { viewColumn: vscode.ViewColumn.Two }; // ← always Two, even if it doesn't exist
}ViewColumn.Two is fixed by ordinal — VS Code creates the group on demand if it isn't there.
Proposed behavior
For terminals that today resolve to ViewColumn.Two (the else branch — builder and shell types), conditionally pick the target column:
const groupCount = vscode.window.tabGroups.all.length;
location = { viewColumn: groupCount >= 2 ? vscode.ViewColumn.Two : vscode.ViewColumn.One };Architect terminals (ViewColumn.One) and dev/panel terminals stay exactly as they are.
Acceptance criteria
- When at least two editor groups exist at spawn time, a new builder terminal attaches to the second group (unchanged from today).
- When only one editor group exists at spawn time, the new builder terminal attaches to the first/default group without creating a new group.
- Same rule applies to shell-type terminals (they share the
ViewColumn.Twobranch today). - Architect terminals (
ViewColumn.One) and dev / panel terminals are untouched. - No new configuration setting — the behavior is unconditional.
- Existing focus /
show(!focus)semantics preserved (cursor doesn't jump unexpectedly).
Out of scope
- A user-facing setting to choose between "force second group" (old) and "attach if exists" (new).
- Re-positioning existing builder terminals when the user later splits / unsplits groups.
- Cross-builder grouping (e.g. all builders in one group, dev terminals elsewhere).
Related
- vscode: builder terminal unopenable after move-between-groups + close (silent failure, requires VS Code restart) #803 — builder terminal unopenable after move-between-groups + close. Same area of code; uncoordinated changes to the spawn site could mask or be masked by the move bug. Keep these two PRs sequenced.
Activity
amrmelsayed commentedon Jun 13, 2026
On it! Working on a fix now.
[Bugfix #804] vscode: attach builder terminals to second editor group…
Merge pull request #1041 from cluesmith/builder/bugfix-804
vscode CHANGELOG + release notes: #804 don't force-create a second ed…