Documentation
¶
Index ¶
- type Block
- func (b *Block) Finish()
- func (b *Block) Log(line string)
- func (b *Block) Milestone(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(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) 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.