+ columns := terminalColumns(out)
+ if columns > 0 && (event.Kind == "reply" || event.Kind == "work") {
+ text = strings.Join(terminalMarkdown(text, columns), "\n")
+ }
+
+ switch event.Kind {
+ case "busy":
+ busy = true
+ case "idle":
+ busy = false
+ }
+
+ text += "\n"
+ if prompt {
+ text = "\r\x1b[2K" + text
+ }
+
+ prompt = columns > 0 && !busy
+ if prompt {
+ text += "> "
+ }
+
+ _, err = io.WriteString(out, text)