fix(tui): copy transcript selections without visual wraps#1906
Open
knqiufan wants to merge 1 commit into
Open
Conversation
Preserve logical transcript text when TUI-owned mouse selection copies wrapped assistant output.
Contributor
There was a problem hiding this comment.
Code Review
This pull request enhances the TUI's copy-paste behavior by introducing metadata to distinguish between visual and logical line breaks. By tracking CopyLineSeparator and copy_prefix_width throughout the rendering pipeline, the selection logic can now remove soft-wrap newlines and strip visual prefixes from code blocks and lists, ensuring the copied text matches the source content. The changes include updates to history rendering, markdown processing, and the selection-to-text logic, along with new unit tests and documentation updates. I have no feedback to provide.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan
cargo test -p deepseek-tui --bin deepseek-tui selection_to_textcargo test -p deepseek-tui --bin deepseek-tui mouse_selection_autocopies_on_release_without_ctrl_ccargo clippy -p deepseek-tui --all-targets --all-features--mouse-capture, drag-copying a long assistant paragraph pastes as one logical paragraph.Notes
cargo test -p deepseek-tui --bin deepseek-tuicurrently fails on unrelated config/skills tests in this local environment:change_in_non_english_without_api_key_uses_explicit_fallback,test_list_skills_empty_directory,test_list_skills_filters_by_name_prefix, andapp_new_detects_missing_api_key_with_default_config.