Skip to content

fix(cortex-tui-capture): preserve full Unicode symbols in TUI frame capture#219

Merged
echobt merged 1 commit intomasterfrom
fix/tui-capture-full-symbols
Jan 27, 2026
Merged

fix(cortex-tui-capture): preserve full Unicode symbols in TUI frame capture#219
echobt merged 1 commit intomasterfrom
fix/tui-capture-full-symbols

Conversation

@echobt
Copy link
Contributor

@echobt echobt commented Jan 27, 2026

Summary

Fixes an issue where TUI capture frames were displaying incorrectly or empty because only the first character of each cell's symbol was being stored.

Problem

When running with CORTEX_TUI_CAPTURE=1 CORTEX_TUI_CAPTURE_ALL=1 cargo run --bin cortex, the captured frames were not displaying properly because:

  1. SnapshotCell stored only a single char instead of the full symbol
  2. from_ratatui_buffer used .chars().next() which truncated multi-character grapheme clusters
  3. Box-drawing characters, emojis, and other Unicode symbols that span multiple bytes were being cut off

Solution

  • Changed SnapshotCell.character: char to SnapshotCell.symbol: String to preserve full symbols
  • Updated from_ratatui_buffer to store the complete symbol from each cell
  • Updated to_ascii and to_ansi methods to output the full symbol string
  • Added helper methods (from_symbol, symbol_with_style, character()) for convenience and backward compatibility

Testing

All 33 tests in cortex-tui-capture pass:

test result: ok. 33 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

Both cargo check -p cortex-tui-capture and cargo check -p cortex-tui compile successfully.

…apture

Previously, the capture system only stored the first character of each
cell's symbol, which truncated multi-character grapheme clusters and
some Unicode box-drawing characters. This caused the captured frames
to display incorrectly or show empty content.

Changes:
- Changed SnapshotCell to store full symbol as String instead of char
- Updated from_ratatui_buffer to preserve the complete symbol
- Updated to_ascii and to_ansi methods to output full symbols
- Added from_symbol and symbol_with_style helper methods
- Added character() method for backward compatibility
- Updated tests to verify the new behavior
@echobt echobt merged commit 1c5978c into master Jan 27, 2026
2 of 12 checks passed
@echobt echobt deleted the fix/tui-capture-full-symbols branch January 27, 2026 12:42
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