MCPcopy Create free account
hub / github.com/betta-tech/byo-coding-agent / ReadChatInput

Function ReadChatInput

internal/ui/input.go:119–137  ·  view source on GitHub ↗

ReadChatInput shows the bordered input box and blocks until the user submits or hits ctrl-d. Returns (text, ok). ok=false on exit.

()

Source from the content-addressed store, hash-verified

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.
119func 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

Callers

nothing calls this directly

Calls 5

TermWidthFunction · 0.85
newChatInputFunction · 0.85
loadHistoryFunction · 0.85
appendHistoryFunction · 0.85
RunMethod · 0.65

Tested by

no test coverage detected