MCPcopy Create free account
hub / github.com/betta-tech/byo-coding-agent / replaceBanner

Method replaceBanner

internal/ui/program.go:868–879  ·  view source on GitHub ↗

replaceBanner regenerates the banner with the current shine column and splices it into place inside m.output. Anything written after the banner (the user's first prompt, agent output, etc.) is preserved — replaceBanner only rewrites the leading byte range that bannerEnd points at. Width comes from m

()

Source from the content-addressed store, hash-verified

866// comes from m.bannerWidth (captured before the stdout redirect) rather
867// than a fresh TermWidth() call.
868func (m *harness) replaceBanner() {
869 post := ""
870 full := m.output.String()
871 if m.bannerEnd > 0 && m.bannerEnd <= len(full) {
872 post = full[m.bannerEnd:]
873 }
874 animated := AnimatedBanner(m.bannerWidth, m.shineCol)
875 m.output.Reset()
876 m.output.WriteString(animated)
877 m.bannerEnd = m.output.Len()
878 m.output.WriteString(post)
879}
880
881// setConversationContent pushes the current scrollback buffer into the
882// viewport, wrapping it to the viewport's width first so long lines

Callers 1

UpdateMethod · 0.95

Calls 1

AnimatedBannerFunction · 0.85

Tested by

no test coverage detected