Commit Graph
4 Commits
Author SHA1 Message Date
Brandon McGintyandClaude Opus 5 314b838e33 bound the chat scrollback and wrap only new lines
AddLine re-wrapped every stored line on each append, and the buffer it
re-wrapped had no upper bound, so the work a session did grew as the square
of its length. Wrapping also built each display line by concatenating one
rune at a time, reallocating per character.

Wrap just the line being added, build it with a strings.Builder, and cap the
retained history. Trimming is done a block at a time because it forces a
rebuild; discarding a single line per append would re-wrap the whole buffer
again.

Measured over the same benchmark, 4000 lines went from 42s and 18.8GB
allocated to 4ms and 1MB, and 20000 lines now complete in 85ms.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-24 12:30:23 -04:00
Brandon McGintyandClaude Opus 5 17a4662c6c strip terminal control sequences from server-supplied text
Remove control, DEL, and bidi characters before display.
HTML escaping was the only filter, which leaves ANSI and OSC escape
sequences intact. A remote user could move the cursor, recolour the
screen, or reorder what was shown by putting escape codes in a
message, a nickname, or a channel name. Names rendered in the channel
tree go through the same filter now.

Keep the text box cursor and the prompt on rune boundaries.
Both indexed by byte, so editing a line containing multi-byte
characters could split one and render replacement characters.

Handle text view lines that carry no timestamp.
Toggling timestamps assumed every stored line had one and sliced past
the end of lines that did not.

Ignore key events on an empty tree.
The handlers indexed the item list before checking that it had any
items.

Remove the beep helpers.
They shelled out to an optional "beep" binary and panicked when it was
absent.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-20 14:42:52 -04:00
Storm Dragon 7fed25e8d0 Fix chat redraw and input history 2026-07-14 19:08:38 -04:00
Storm Dragon 3f0246a4f8 Initial commit, lots of cleanup and stuff to do, it may not work. 2025-01-15 23:43:44 -05:00