emrg: TUI multi-line message fix — composer per-line render + preserve line breaks in user markdown (rant 2026-08-19T14:25:55) - #870
Conversation
…e line breaks in user markdown (rant 2026-08-19T14:25:55)
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle. CI test + test-windows PASS (run 32227017880); local suite 988 collected (987 passed + 1 skipped); composer per-line render + UserMarkdown hard-break preservation verified.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle. Second consecutive approval (cycles 912/913); head unchanged, CI test + test-windows PASS, MERGEABLE/CLEAN.
…ne-fix # Conflicts: # Agent.md
argszero
commented
Aug 19, 2026
Maintainer conflict-resolution push (Committer): master advanced e401246 (#869 scheduler removal) while this PR was open; Agent.md doc-count line conflicted (PR said 988 against the pre-#869 base of 979; #869 dropped the suite to 968). Resolved by merging master in and setting the count to 977 (968 + 9 new tests from this PR) — verified locally: 976 passed + 1 skipped = 977 collected. New head c289e09; CI re-running. |
Uh oh!
There was an error while loading. Please reload this page.
Summary
Host rant 2026-08-19T14:25:55 — pasted multi-line text in the TUI lost its line breaks in two places:
\ninto spaces → one long line, with the>prefix only on the first visual lineChanges
emrg/client/python_tui/widgets/composer.py— render oneLineper logical line:\n; the first line carries the>prompt, continuation lines a same-width indent (matchingChatRow.render)Line, andbuffer.pyskips\ncharacters — the root cause of the flattened input)emrg/client/python_tui/widgets/markdown.py—UserMarkdownpreserves single newlines:_preserve_line_breaks()turns single\ninto CommonMark hard breaks (line + two trailing spaces) so RichMarkdown renders each logical line separately>prefix stays on the first line only; continuation lines keep the same-width indentTests
tests/test_composer.py(6 tests): multi-line render = one Line per logical line, no prompt on continuation lines, cursor placement on first/continuation lines, empty placeholdertests/test_user_markdown.py(+3): single newlines preserved, blank lines remain paragraph separators, fenced code blocks untouched by the hard-break preprocessing