Repository navigation
fix(ui): 修复 macOS 下日志面板无法复制文字 - #66
Merged
Merged
Conversation
TerminalControl only handled Ctrl+C, so Cmd+C did nothing on macOS and log output could not be copied. Accept both Ctrl and Cmd for copy and select-all, and add a context menu with Copy / Select All / Copy All.
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.
变更说明
macOS 下日志输出面板里的文字无法复制。
TerminalControl本身支持用鼠标拖选文字,但复制快捷键只判断了Ctrl+C。macOS 上的复制习惯是Cmd+C,所以选中后按快捷键没有任何反应,面板里也没有其他复制入口。本 PR 只改动了
src/EasyCon2.Avalonia/Terminal/TerminalControl.cs:Ctrl和Cmd:Ctrl/Cmd+C复制选中内容,Ctrl/Cmd+A全选。Windows 上的原有行为不变。SelectAll()。关联 Issue
无关联 Issue。这是排查 #56(macOS 下 ESP32 握手失败)时发现的问题:需要把串口日志复制出来分析,但复制不了。属于不涉及核心功能和架构的小幅 bug 修复,按 CONTRIBUTING.md 可以直接提交。
变更类型
人工审核声明
自查清单
dotnet build通过dotnet test EasyCon2.slnx -c Release通过(macOS 上运行,Windows 专用的EasyCon.WinInput.Tests未运行)dotnet format --verify-no-changes无差异验证方式
在 macOS(Apple Silicon)上运行 GUI,连接串口设备,让日志面板产生输出,然后:
Cmd+C,可以粘贴到其他应用。改动前没有反应。Cmd+C可以复制。Windows 上的
Ctrl+C走的是原来的逻辑,没有变化。