Show the connection state in the neoirc-cli status bar (closes #229)
check / check (push) Canceled after 0s

The status bar has colour tags turned on, so tview read "[connected]"
and "[disconnected]" as colour names and dropped them. It dropped the
bracketed part of a nick such as "erin[away]" the same way.

renderStatusBar now passes the whole status line through tview.Escape,
so every bracket shows as it is. TestStartUp checks that the status
bar shows [disconnected] at start-up. TestStatusBar checks [connected]
with plain nicks and with nicks that hold brackets.

Model: opus-5-5
This commit is contained in:
clawbot
2026-11-02 01:14:37 +00:00
parent 59f1208d8d
commit d1cb9f8044
2 changed files with 75 additions and 3 deletions
+5 -2
View File
@@ -332,10 +332,13 @@ func (ui *UI) renderStatusBar(
ui.statusBar.Clear()
_, _ = fmt.Fprintf(ui.statusBar,
// The status bar has colour tags turned on, so tview would read
// "[connected]", or a name in square brackets, as a colour tag
// and drop it. Escape makes it show every bracket as it is.
_, _ = fmt.Fprint(ui.statusBar, tview.Escape(fmt.Sprintf(
" [%s] %s %s %s%s",
connStatus, nick, bufInfo, target, unread,
)
)))
}
func (ui *UI) getOrCreateBuffer(name string) *Buffer {