Skip to content

[v0.4] Add tabs over window layouts #32

Description

@owainlewis

Goal: Add tabs as saved window layouts, not as another buffer abstraction.

Context: The PRD treats tabs as groups of split layouts.
This should land after the split window layout tree so tabs can swap whole layouts instead of special-casing editor state.

Proposed approach:

  • Add a tab list where each tab owns one window layout tree.
  • Keep buffers shared across tabs through the editor-level buffer list.
  • Add commands for tab-new, tab-next, and tab-close.
  • Bind C-x t 2, C-x t o, and C-x t 0 if the keymap supports those sequences cleanly.
  • Render a restrained tab indicator or modeline/tabline treatment.
  • Preserve dirty state, save behavior, and focused window state across tab switches.

Acceptance criteria:

  • Creating a new tab creates a fresh layout while keeping existing buffers available.
  • Switching tabs restores the previous layout and focused window for that tab.
  • Closing a tab removes that layout without deleting buffers or unsaved edits.
  • The last tab cannot be closed into an invalid empty editor state.
  • Dirty buffers remain protected on quit even when they are not visible in the active tab.
  • Existing split behavior still works inside each tab.

Verification:

  • Run cargo test.
  • Manually create tabs, split windows inside a tab, switch tabs, close tabs, save dirty buffers, and quit.
  • Manually confirm terminal cleanup after exit.

Out of scope:

  • Named tabs.
  • Persisted sessions.
  • Dragging or reordering tabs.
  • Tab-specific working directories.
  • Embedded terminal panes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions