MCPcopy Create free account
hub / github.com/codehamr/codehamr / TestSlashClearWipesTerminalScrollback

Function TestSlashClearWipesTerminalScrollback

internal/tui/tui_test.go:857–866  ·  view source on GitHub ↗

TestSlashClearWipesTerminalScrollback: tea.ClearScreen (\x1b[2J) clears only the visible region; the saved-lines buffer needs the DECSED 3 sequence from eraseScrollback. /clear must emit both, or prior lines stay scrollable above the reset banner.

(t *testing.T)

Source from the content-addressed store, hash-verified

855// eraseScrollback. /clear must emit both, or prior lines stay scrollable above
856// the reset banner.
857func TestSlashClearWipesTerminalScrollback(t *testing.T) {
858 m := newTestModel(t, func(http.ResponseWriter, *http.Request) {})
859 _, cmd := m.runSlash("/clear")
860 if !cmdYieldsClearScreen(cmd) {
861 t.Error("/clear must wipe the visible viewport via tea.ClearScreen")
862 }
863 if !cmdYieldsScrollbackErase(cmd) {
864 t.Error("/clear must also emit eraseScrollback (\\x1b[3J) - otherwise old replies stay scrollable above the reset banner")
865 }
866}
867
868// TestArgPopoverReloadsCfgOnEntry: the arg popover builds its list from
869// m.cfg.Models. Without the cmd→arg reload in refreshSuggest, the first

Callers

nothing calls this directly

Calls 5

newTestModelFunction · 0.85
cmdYieldsClearScreenFunction · 0.85
cmdYieldsScrollbackEraseFunction · 0.85
runSlashMethod · 0.80
ErrorMethod · 0.80

Tested by

no test coverage detected