Skip to content

terminal: support tabs on top and bottom - #337729

Open
Alex Stockwell (astockwell) wants to merge 7 commits into
microsoft:mainfrom
astockwell:astockwell/terminal-tabs-top-bottom
Open

Alex Stockwell (astockwell) wants to merge 7 commits into
microsoft:mainfrom
astockwell:astockwell/terminal-tabs-top-bottom

Conversation

@astockwell

@astockwell Alex Stockwell (astockwell) commented Sep 24, 2026 •

Copy link
Copy Markdown

Fixes #252647.

Summary

Add top and bottom values to terminal.integrated.tabs.location. These locations display a single horizontally scrolling row inside the Terminal view, reclaiming terminal width in narrow panels and sidebars. The existing left/right layouts and right default are unchanged.

terminal-tabs-top
  • Keep one entry per terminal instance, including split terminals, with visual group boundaries.
  • Preserve terminal processes, selection, focus, and saved side-list widths when switching layouts.
  • Reuse terminal labels, statuses, rename controls, commands, and drag-and-drop/re-ordering behavior. Support multi-selection, keyboard navigation, task actions, and hidden chat terminals.
  • Give terminal-tab accessibility help its own provider identity, retain the existing terminal verbosity setting, and restore the originating tab's focus. Expose the active terminal with aria-current independently of multi-selection.
  • Update only the affected tab for routine title/status/icon events, preserving focused action controls and batching geometry scans.
  • Decouple command targeting from the concrete vertical list. Context menus on unselected terminals target only that terminal; menus on selected terminals retain the selection.

This does not add multiple independent Terminal views or change terminal-editor tabs.

Existing-behavior fixes

  • Explicit Focus Terminal Tabs returns to the selected terminal, or the active terminal when there is no selection; layout changes preserve the previously focused tab instead.
  • In left/right layouts, hidden-chat-terminal entries reduce only the tabs list's height, not terminal content height.
  • Cross-window terminal drops honor the target position. Tab actions receive each selected terminal rather than repeating the clicked terminal.
  • Avoid duplicate layouts in shared event handlers and skip full layouts for mouse-leave or hidden-terminal updates when visibility and geometry are unchanged.
  • Keyboard context menus use keyup/native-event coordination, Select All uses normalized keyboard events, and the configured mouse multi-select modifier is honored without breaking default Alt-click splitting.
  • Failed drops display one error notification with partial-transfer context, while core failures still reject.
terminal-tabs-bottom

How to try it

  1. Set "terminal.integrated.tabs.location": "top" and "terminal.integrated.tabs.hideCondition": "never".
  2. Create multiple terminals, including a split group. Check selection, rename, split/kill, task actions, and drag-and-drop.
  3. Switch to "bottom", "left", and "right" while terminals are running. The empty tab-area context menu also exposes the location actions.
  4. Move the panel to the right or make the Terminal view narrow. Horizontal tabs should scroll while terminal content retains the available width.
  5. Focus the tabs and use Left/Right, Home/End, range selection, and accessibility help. Existing platform-specific rename shortcuts remain intact.

Validation

  • Client TypeScript check and targeted TS/CSS lint passed.
  • 102 targeted browser tests passed in each of Chromium and WebKit.
  • The Terminal Tabs Electron smoke suite passed: 12 tests, with one pre-existing skipped test.
  • Disposable-leak checks and a 250-tab/1,000-event regression verify retained action controls and batched geometry work.
  • On macOS arm64, a Code OSS 1.140.0 Dev scenario verified live title updates while Kill retained focus, live layout changes, accessibility help/focus restoration, moving a running shell between independent windows, and restoration/rename after reload.
  • A fresh independent review identified context-menu targeting and late-added task-action regressions; both are fixed with regression coverage.

Remaining coverage limits

Native Windows/Linux and spoken VoiceOver/NVDA behavior have not been manually verified. Tests exercise all three platform key-handling variants locally. Remote reconnection has mocked-backend coverage rather than an end-to-end remote-host run. Firefox could not start in the local macOS sandbox/graphics environment.

AI assistance: GitHub Copilot CLI, GPT-6 Astra (model ID/version: gpt-6-astra).

Add a horizontal terminal tab strip with shared actions, accessible keyboard navigation, live layout switching, and regression coverage for microsoft#252647.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings September 24, 2026 15:32
@vs-code-engineering

vs-code-engineering Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

Anthony Kim (@anthonykim1)

Matched files:

  • src/vs/workbench/contrib/terminal/browser/media/terminalTabsBar.css
  • src/vs/workbench/contrib/terminal/browser/terminal.ts
  • src/vs/workbench/contrib/terminal/browser/terminalActions.ts
  • src/vs/workbench/contrib/terminal/browser/terminalGroupService.ts
  • src/vs/workbench/contrib/terminal/browser/terminalTabbedView.ts
  • src/vs/workbench/contrib/terminal/browser/terminalTabsBar.ts
  • src/vs/workbench/contrib/terminal/browser/terminalTabsChatEntry.ts
  • src/vs/workbench/contrib/terminal/browser/terminalTabsList.ts
  • src/vs/workbench/contrib/terminal/browser/terminalTabsWidget.ts
  • src/vs/workbench/contrib/terminal/common/terminal.ts
  • src/vs/workbench/contrib/terminal/common/terminalConfiguration.ts
  • src/vs/workbench/contrib/terminal/test/browser/terminalTabs.test.ts
  • src/vs/workbench/contrib/terminalContrib/accessibility/browser/terminal.accessibility.contribution.ts
  • src/vs/workbench/contrib/terminalContrib/accessibility/browser/terminalAccessibilityHelp.ts
  • src/vs/workbench/contrib/terminalContrib/accessibility/test/browser/terminalTabsAccessibilityHelp.test.ts

@astockwell

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree company="GitHub"

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Configuration changes can lose keyboard focus, and vertical native drops can leave stale focus that targets the wrong terminal.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 2 Medium severity

Open (2)
What changed in this PR

Adds horizontal terminal tabs at the top or bottom while preserving existing side-list behavior.

Changes:

  • Adds configurable horizontal tab rendering, navigation, actions, and drag-and-drop.
  • Extends accessibility help and command targeting.
  • Adds broad unit, automation, and smoke coverage.
File Description
test/​smoke/​src/​areas/​terminal/​terminal-tabs.test.ts Tests horizontal tabs end-to-end.
test/​automation/​src/​terminal.ts Adds horizontal-tab selectors and assertions.
src/​vs/​workbench/​test/​browser/​workbenchTestServices.ts Updates the terminal service test double.
terminalAccessibilityHelp.ts Documents tab locations.
terminal.accessibility.contribution.ts Adds tab-specific accessibility help.
terminalTabs.test.ts Covers layout, navigation, actions, DnD, and performance.
terminalConfiguration.ts Registers top and bottom settings.
common/​terminal.ts Extends the location type.
terminalTabsWidget.ts Defines the shared tabs-widget interface.
terminalTabsList.ts Shares rendering, actions, and DnD behavior.
terminalTabsChatEntry.ts Prevents handled keys from bubbling.
terminalTabsBar.ts Implements the horizontal tab row.
terminalTabbedView.ts Switches layouts dynamically.
terminalGroupService.ts Exposes selected tab instances.
terminalActions.ts Decouples actions from the vertical list.
browser/​terminal.ts Extends the group-service contract.
terminalTabsBar.css Styles horizontal tabs and states.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/vs/workbench/contrib/terminal/browser/terminalTabbedView.ts Outdated
Comment thread src/vs/workbench/contrib/terminal/browser/terminalTabsList.ts
Restore terminal focus when changing tab location also hides the tabs. Keep vertical drop selection, focus, and command targets aligned, with regressions for both PR review findings.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Handle keyboard context menus on keyup, honor configured multi-selection modifiers, and normalize Select All across keyboard layouts. Report failed drops once with explicit partial-transfer context while preserving core rejection semantics.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Restore selected-terminal focusing for the explicit command while preserving focus across layout changes. Avoid duplicate and unchanged-state layouts, give tab help an independent provider identity, and expose the active terminal separately from selection.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
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.

Integrated terminal tabs on the top or bottom

3 participants