Skip to content

[feature][1.4.1] SegmentId::Vcs native prompt segment - wire the 2.5ms git2 renderer into the segments engine (oh-my-niu bundle already declares it) #331

Closed

Description

@caomengxuan666

Context

The oh-my-niu bundle (prompts/segments.toml) already declares the git segment: [segments.git] id = "vcs" — "Git branch and compact repository status". Themes/presets reference it. The niubash segments engine (SegmentId in prompt_segments.rs) has Dir/Status/Time/Context/... but no Vcs segment — the declaration is a socket with no power.

The renderer already exists: #292's Git Bash compatible factory default theme renders git branch+dirty via git2 in-process (warm p50 2.5ms, zero child processes) — src/git_prompt.rs.

Scope (1.4.1)

  1. SegmentId::Vcs native segment: data source = the feat(prompt): built-in Git Bash compatible factory default on Windows #292 git_prompt renderer (git2, in-process; no command substitution — the WIP: Windows test-content layer — tool-identity stand-down for issue76_93 (root D-2) #604 lesson: PS1-embedded $(...) is 100x slower, native segments bypass that entirely).
  2. Wire vcs id in SegmentId::from_name; oh-my-niu bundle segments.toml resolves cleanly.
  3. Segment rendering honors theme colors ([git_clean]/[git_dirty] styling already declared in oh-my-niu themes) + owner-approved format (branch, branch*, short-SHA detached).
  4. Performance assertion: segment render p50 ≤ 10ms (10x headroom over the 2.5ms measured), zero child processes.
  5. oh-my-niu bundle preset integration: at least one shipped preset gains the git segment as a showcase.

Out of scope

Owner ruling 2026-10-14: land in 1.4.1.

Activity

  1. added
    enhancement
    area:interactive
    on Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:interactiveenhancementfeature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions