@@ -74,10 +74,15 @@ func (m ttyModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
7474 }
7575
7676 case EventBuildSummary :
77- // Store the summary on the model so View() renders it as the
78- // final frame when the program quits via Close().
77+ // Print the summary via Printf (which scrolls it above the
78+ // view) instead of rendering it through View(). Inline-image
79+ // escape sequences from emoji.Render confuse Bubbletea's
80+ // cursor tracking, causing lines to vanish on re-render.
7981 m .summary = & msg
80- return m , nil
82+ return m , tea .Sequence (
83+ tea .Printf ("%s" , buildSummaryView (msg )),
84+ tea .Quit ,
85+ )
8186
8287 case EventTestFailure :
8388 if len (msg .TestFailures ) > 0 {
@@ -129,10 +134,6 @@ func (m ttyModel) hardwrapLine(s string) string {
129134func (m ttyModel ) render () string {
130135 separator := ttyBorderStyle .Render ("─────────────────────────────────────────────" )
131136
132- if m .summary != nil {
133- return buildSummaryView (* m .summary )
134- }
135-
136137 statusLine := fmt .Sprintf (" %s %s" , m .spinner .View (), ttyStatusStyle .Render (m .statusText ()))
137138
138139 if m .latest .Jobs == nil {
@@ -161,6 +162,11 @@ func (m ttyModel) render() string {
161162}
162163
163164func (m ttyModel ) View () string {
165+ if m .summary != nil {
166+ // Summary was already printed via tea.Printf; return empty
167+ // so Bubbletea clears the spinner area on exit.
168+ return ""
169+ }
164170 return m .hardwrapLine (m .render ())
165171}
166172
0 commit comments