Skip to content

Session mirror: live word-splitting for merged text #33

@martymcenroe

Description

@martymcenroe

Problem

The session mirror produces word-merged text like I'llreadthecodebase because the Ink TUI renders adjacent characters without column gaps. The cursor-tracking parser in mirror_strip_ansi() correctly sees no gap but the result is unreadable prose.

Issue #29 accepts this limitation for the initial fix (plan B+D+F). This issue tracks the harder problem of splitting merged words in the live mirror.

Approach: Hybrid strip + selective wordninja

  1. Replace mirror_strip_ansi() with the simpler strip_ansi() (regex replace with space + collapse) for mirror output
  2. For lines that look like prose (>40 chars, no code indicators like /, \, ::, {, }), run wordninja.split() and rejoin
  3. Leave code-like lines (paths, commands, SQL) untouched

Performance

Depends on

Alternative

If wordninja is too aggressive (splits identifiers, URLs), consider a lighter approach: insert spaces before capital letters in runs of 30+ lowercase chars. Catches readthecodebaseread the codebase but won't help with Doyouwanttoproceed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions