ReadChatInput shows the bordered input box and blocks until the user submits or hits ctrl-d. Returns (text, ok). ok=false on exit.
()
| 117 | // ReadChatInput shows the bordered input box and blocks until the user |
| 118 | // submits or hits ctrl-d. Returns (text, ok). ok=false on exit. |
| 119 | func ReadChatInput() (string, bool) { |
| 120 | w := TermWidth() |
| 121 | if w == 0 { |
| 122 | w = 80 |
| 123 | } |
| 124 | m := newChatInput(w, loadHistory()) |
| 125 | final, err := tea.NewProgram(m).Run() |
| 126 | if err != nil { |
| 127 | return "", false |
| 128 | } |
| 129 | result := final.(chatInputModel) |
| 130 | if !result.done { |
| 131 | return "", false |
| 132 | } |
| 133 | if result.submitted != "" { |
| 134 | appendHistory(result.submitted) |
| 135 | } |
| 136 | return result.submitted, true |
| 137 | } |
| 138 | |
| 139 | // ── confirm prompt ──────────────────────────────────────────────────────── |
| 140 |
nothing calls this directly
no test coverage detected