Documentation
¶
Index ¶
- type Block
- func (b *Block) Finish()
- func (b *Block) Log(line string)
- func (b *Block) Milestone(prefix, status, text string)
- func (b *Block) Pause()
- func (b *Block) Restore()
- func (b *Block) Resume()
- func (b *Block) SetAction(text string)
- func (b *Block) SetBanner(lines []string)
- func (b *Block) SetConnString(s string)
- func (b *Block) SetProgress(frac float64, title string)
- func (b *Block) Start(title string)
- func (b *Block) Warn(prefix, line string)
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block struct {
// contains filtered or unexported fields
}
Block is a pinned, fixed-height live region on the alternate screen. It owns all pterm usage, its mutex, the spinner ticker and the resize watcher. All exported methods are safe for concurrent use.
func (*Block) Finish ¶
func (b *Block) Finish()
Finish ends the live UI: leaves the alt screen and prints the closing summary.
func (*Block) Milestone ¶
Milestone takes the box prefix of the process block the line came from, on the same terms as Warn: it is applied only when the line is printed inline, and dropped for the pinned milestone region and the closing summary, which render milestones detached from any block.
func (*Block) Restore ¶
func (b *Block) Restore()
Restore is the safety teardown (signal/panic/early error exit). Like Finish it leaves the alt screen and prints the closing summary, so a fatal error — which never reaches Finish — is still surfaced on the main screen instead of vanishing with the alt buffer. Safe to call multiple times and after Finish.
func (*Block) SetBanner ¶
SetBanner stores the startup ASCII banner lines and triggers a repaint. The banner is shown only when the terminal is tall enough that showing it still leaves room for the full live region — it is the first thing dropped under degradation.
func (*Block) SetConnString ¶
SetConnString stores the SSH connection string and triggers a repaint. The string is rendered as a pinned cyan line just above the logbox and is never scrolled away by milestones. It is also included in the closing summary dump.
func (*Block) SetProgress ¶
func (*Block) Warn ¶
Warn takes the box prefix of the process block the line came from (empty at top level). The prefix is applied only on the paths that print the line inline, interleaved with that block's other lines - during a pause, before the block is active, and after the closing dump - where dropping it would tear the ┌/│/└ frame. The pinned warn region and the closing summary render warnings detached from any block, so there the prefix is dropped: it would draw a frame edge next to a frame that is not on screen.