FEDBOX(1)

NAME
fedbox - box, frame, and panel drawing for fed-field-editor scripts

SYNOPSIS
fedbox row col rows cols [options]

DESCRIPTION
fedbox draws a rectangular box (border, optional interior fill, optional titles and status text) at a given screen position, then exits. It is the non-interactive frame companion to fedsay(1)'s text: where fedsay writes a positioned label and the editors capture a value, fedbox draws the surrounding frames, panels, and dividers a shell-script TUI needs. It speaks the same color vocabulary as the editors' --color through the shared color helper, so colors never drift across the suite.

fedbox runs no curses session. It emits ANSI escape sequences to standard output and is used inline, like tput(1) — run it for its effect on the screen. It is not a field: it captures no input and follows no exit-reason protocol. Exit is 0 on success, 1 on a usage error. There is no trailing newline. Without --keep, the cursor is left at the box's interior origin (row+1,col+1), ready to write the first line of content.

Interactive buttons are deliberately out of scope — an interactive button row would make this a dialog tool, not a drawer. Compose fedbox (the frame) with fedradio --orient horizontal (the button bar) when a dialog is needed.

ARGUMENTS

row col
    Top-left corner, 0-indexed. Either may be @ to mean the terminal's current cursor position (resolved with a CSI 6n query), as with the field editors.

rows
    Box height in terminal rows, including both borders. Minimum 2.

cols
    Box width in terminal columns, including both borders. Minimum 2.

OPTIONS

--style SPEC
    A named style — single (default), double, ascii, solid, half-in, half-out — or a 3-character custom string horz+vert+corner (for example '=:o'). The half styles draw a half-block frame with the ink hugging the interior (half-in) or the exterior (half-out).

--fill [CHAR]
    Fill the interior with CHAR (default a space). Omitting --fill leaves the interior untouched (frame only); supplying it makes a panel. Only the first character is used; a single - is accepted as a fill char. A space fill is visible only when a background color is set.

--color SPEC
    Base color for all elements (border, fill, titles, status). SPEC is either fg,bg (fed color names, optional bright- prefix, or default) or the literal reverse (reverse video).

--border-color SPEC, --title-color SPEC", --status-color SPEC", --fill-color SPEC
    Override the base color for one element group — the border (corners + edges), the top-title text, the bottom-status text, or the interior fill, respectively.

-r, --reverse
    Alias for --color reverse.

--title TEXT
    Centered title on the top border (alias for --center-title).

--left-title, --center-title, --right-title TEXT
    Place titles on the top border. Text is verbatim — no padding is added, so supply your own brackets or spacing for a "[ ... ]" look.

--status TEXT
    Centered status on the bottom border (alias for --center-status).

--left-status, --center-status, --right-status TEXT
    Place status text on the bottom border (verbatim).

--keep
    Save the cursor before drawing and restore it afterward, so drawing a box does not disturb the cursor's position.

-h  Print brief usage and exit.

--help
    Print full help text and exit.

--version
    Print version and copyright information and exit.

OUTPUT SEQUENCE
The emitted escape stream is ordered: save cursor (with --keep), draw the top border (with any titles), the interior rows (filled with --fill, otherwise just the side borders), and the bottom border (with any status), then reset the SGR and rest the cursor — restored with --keep, otherwise placed at the interior origin. Each element group is colored independently (its own --element-color override, else --color); SGR is re-emitted only at color boundaries, so same-colored runs stay contiguous and colors do not bleed.

EXAMPLES

A plain single-line frame, 5 rows by 30 cols:

        fedbox 2 4 5 30

A double-ruled panel filled with spaces, white on blue, centered title (titles are verbatim — add your own brackets):

        fedbox 0 0 10 40 --style double --fill --color white,blue --title "[ Settings ]"

Per-element color — a white-on-blue box with a bright-yellow title:

        fedbox 0 0 8 40 --color white,blue --fill --title "Account" --title-color bright-yellow,blue

A custom style — '=' horizontals, ':' verticals, 'o' corners:

        fedbox 0 0 5 24 --style '=:o'

A half-block frame hugging the interior, dotted fill:

        fedbox 3 3 6 24 --style half-in --fill .

SEE ALSO
fedsay(1), fedline(1), fedarea(1), fedmask(1), fedlist(1), fedcheck(1), fedradio(1), fedform(1), fedmake(1)

COPYRIGHT
fedbox (C) 2026 smisco / fed@smisco.biz