TestCtrlLClosesPopover: Ctrl+L clears the popover along with the prompt. Left open on stale suggestions, the next Enter would take the has-selection path and insert a ghost command into the freshly emptied prompt.
(t *testing.T)
| 1505 | |
| 1506 | // TestCtrlLClearsPromptNotScrollback: Ctrl+L matches Claude Code: it |
| 1507 | // clears the typed input and forces a terminal redraw, but conversation |
| 1508 | // scrollback stays. /clear is the only way to wipe history. |
| 1509 | func TestCtrlLClearsPromptNotScrollback(t *testing.T) { |
| 1510 | m := newTestModel(t, func(http.ResponseWriter, *http.Request) {}) |
| 1511 | m.ta.SetValue("half-written thought") |
| 1512 | m.scroll.WriteString("prior assistant message\n") |
| 1513 | |
| 1514 | out, cmd := m.Update(tea.KeyMsg{Type: tea.KeyCtrlL}) |
| 1515 | om := out.(Model) |
| 1516 | |
| 1517 | if om.ta.Value() != "" { |
| 1518 | t.Fatalf("Ctrl+L must clear typed prompt, got %q", om.ta.Value()) |
| 1519 | } |
| 1520 | if !strings.Contains(om.scroll.String(), "prior assistant message") { |
| 1521 | t.Fatalf("Ctrl+L must NOT wipe scrollback, got %q", om.scroll.String()) |
| 1522 | } |
| 1523 | if cmd == nil { |
| 1524 | t.Fatal("Ctrl+L should return tea.ClearScreen cmd to force terminal redraw") |
| 1525 | } |
| 1526 | } |
| 1527 |
nothing calls this directly
no test coverage detected