Skip to content

feat(table): add --border-row to draw a separator between every row#1084

Open
WladmirJunior wants to merge 2 commits into
charmbracelet:mainfrom
WladmirJunior:feat/table-border-row
Open

feat(table): add --border-row to draw a separator between every row#1084
WladmirJunior wants to merge 2 commits into
charmbracelet:mainfrom
WladmirJunior:feat/table-border-row

Conversation

@WladmirJunior

@WladmirJunior WladmirJunior commented Jun 3, 2026

Copy link
Copy Markdown

What

Exposes two lipgloss/table capabilities that the table command did not surface:

  • --border-row (env GUM_TABLE_BORDER_ROW) — draw a horizontal separator
    between every data row, not just after the header.
  • --width (env GUM_TABLE_WIDTH) — set a fixed total table width; columns
    auto-size to fit. 0 (default) keeps the current content-based sizing.

Both are opt-in; defaults are unchanged, so no behavior change for existing users.

Why

lipgloss/table already supports BorderRow(true) and Width(w); gum table
just did not expose them. Per-row dividers match what SQL CLIs (grid mode),
tabulate (grid) and tty-table do by default, and a fixed width lets a table
line up with surrounding UI (e.g. a header box of the same width).

Before / After

printf "Machine type|Personal Mac
AI agent CLIs|claude, codex
" | \
  gum table -p --separator="|" --border double --columns "Component,Selection"

Before (content-sized, divider only after the header):

╔══════════════╦══════════════╗
║ Component    ║ Selection    ║
╠══════════════╬══════════════╣
║ Machine type ║ Personal Mac ║
║ AI agent CLIs║ claude, codex║
╚══════════════╩══════════════╝

After (--border-row --width 72):

╔═══════════════════════════════════╦══════════════════════════════════╗
║ Component                         ║ Selection                        ║
╠═══════════════════════════════════╬══════════════════════════════════╣
║ Machine type                      ║ Personal Mac                     ║
╠═══════════════════════════════════╬══════════════════════════════════╣
║ AI agent CLIs                     ║ claude, codex                    ║
╚═══════════════════════════════════╩══════════════════════════════════╝

lipgloss/table already supports BorderRow(true); this exposes it as a
CLI flag (and GUM_TABLE_BORDER_ROW env) on the table command print path.
lipgloss/table already supports Width(w); this exposes it as a CLI flag
(and GUM_TABLE_WIDTH env). Pairs with --border-row for fixed-width grids.
WladmirJunior added a commit to WladmirJunior/dotfiles that referenced this pull request Jun 10, 2026
Drop stock gum entirely (no brew/apt gum) — until PR charmbracelet/gum#1084 lands the fork is the only gum, on both macOS and Linux ARM. lib/ui.sh now has one source of truth for the binary (UI_GUM_USE_FORK / UI_GUM_REPO / UI_GUM_TAG + ui_gum_asset), so switching to upstream after the merge is a one-line change. ui_ensure_gum fetches gum-<os>-<arch> (darwin-arm64, linux-arm64) to the Santa-allowed path. Fixes the old 404 (asset was a .tar.gz, not the bare binary).
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.

1 participant