Repository navigation
tui: 鼠标拖动选择文字,松开自动复制 - #90
Merged
Merged
Conversation
Mouse capture (for wheel scrolling) keeps the terminal from selecting text, so dragging did nothing. A left-button drag now marks a span inside the chat or the prompt box, draws it reversed, and on release copies its text (read back from the frame, wide characters kept whole) through the native clipboard tool or OSC 52. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014BrrmWMes5EESLagmFZYrD
|
Graphify reviews are paused for this workspace because nobody has used it in 7 days. A workspace owner can resume reviews from the Repositories page: https://app.graphify.com/angus-lab/repositories |
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.
Requested by jack mini · project thread
问题
TUI 启动时开启了鼠标捕获(
EnableMouseCapture,为了滚轮滚动),终端因此不再自己处理鼠标选择,拖动选不中文字,也就没法复制。修改
src/tui/select.rs:左键拖动在起点所在区域(对话区或输入框,弹窗时为全屏)内选中一段文字,反色显示;松开时从渲染好的帧里读回文字(中文等宽字符不会被拆成空格),通过系统剪贴板工具复制,没有工具时退回 OSC 52,并提示“已复制 N 个字符”。copy_text。/mouse说明与docs/learning-rust.md快捷键表补充:仍可按住 Shift 拖动或/mouse关闭捕获使用终端原生选择。测试
cargo test:112 个全部通过(新增 5 个选区单测:单行、反向多行、宽字符、区域裁剪、高亮)。cargo clippy --all-targets无警告。Generated by Claude Code