Skip to content

Conversation

@joshka-oai
Copy link
Collaborator

Summary

  • Add narrative docs for the ChatComposer + PasteBurst paste-burst state machine (Windows/non-bracketed paste).
  • Add deterministic unit tests for the burst state machine and composer integration (IME/non-ASCII, retro-capture, Enter handling, slash-context escape hatch).
  • Add markdownlint-cli2 config for the new doc (MD013 line length 100).

Behavior changes

  • Flush buffered burst before applying non-char keys (prevents a stuck buffer).
  • disable_paste_burst fully bypasses burst logic and flushes any pending held first char when toggled on.

Tests

  • cd codex-rs && cargo test -p codex-tui bottom_pane::paste_burst
  • cd codex-rs && cargo test -p codex-tui bottom_pane::chat_composer
  • cd codex-rs && cargo test -p codex-tui2 bottom_pane::paste_burst
  • cd codex-rs && cargo test -p codex-tui2 bottom_pane::chat_composer

On some terminals (notably Windows), multiline pastes arrive as a
rapid stream of Char/Enter key events rather than a single paste
event. ChatComposer treats these bursts as a small state machine so
it can buffer the burst, suppress side effects (e.g. '?' overlay),
and keep Enter as newline during the paste.

This change documents the state machine in detail and adds small,
deterministic tests that pin the tricky transitions:

- Non-ASCII/IME path and retro-capture.
- Enter suppression window and slash-command escape hatch.
- Flushing on non-char keys (avoids a stuck buffer).
- disable_paste_burst bypass + flushes pending first char.

Also adds docs/tui-chat-composer.md plus a markdownlint-cli2 config
(MD013 line length 100) for linting this doc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants