Merge pull request '[agent/codex:gpt-5.4-mini] Read ~/spec/code/core/go/cli/RFC.md fully. Find features des...' (#62) from agent/read---spec-code-core-go-cli-rfc-md-full into dev
All checks were successful
Security Scan / security (push) Successful in 24s

This commit is contained in:
Virgil 2026-04-02 06:39:47 +00:00
commit 5a7335888c
2 changed files with 17 additions and 3 deletions

View file

@ -10,6 +10,7 @@ import (
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
"github.com/charmbracelet/x/ansi"
"golang.org/x/term"
)
@ -428,6 +429,7 @@ func (f *Frame) String() string {
if view == "" {
return ""
}
view = ansi.Strip(view)
// Ensure trailing newline for non-TTY consistency
if !strings.HasSuffix(view, "\n") {
view += "\n"
@ -452,7 +454,6 @@ func (f *Frame) termSize() (int, int) {
return 80, 24 // sensible default
}
func (f *Frame) runLive() {
opts := []tea.ProgramOption{
tea.WithAltScreen(),

View file

@ -145,6 +145,20 @@ func TestFrame_Bad(t *testing.T) {
assert.Equal(t, "", f.String())
})
t.Run("static string strips ANSI", func(t *testing.T) {
f := NewFrame("HCF")
f.out = &bytes.Buffer{}
f.Header(StatusLine("core dev", "18 repos"))
f.Content(StaticModel("body"))
f.Footer(KeyHints("q quit"))
out := f.String()
assert.NotContains(t, out, "\x1b[")
assert.Contains(t, out, "core dev")
assert.Contains(t, out, "body")
assert.Contains(t, out, "q quit")
})
t.Run("back on empty history", func(t *testing.T) {
f := NewFrame("C")
f.out = &bytes.Buffer{}
@ -550,4 +564,3 @@ func TestFrameMessageRouting_Good(t *testing.T) {
})
})
}