Repository navigation
fix(dbg): 修复调试插件中的无限循环问题 - #197
Merged
Merged
Conversation
diqiu114
commented
Oct 9, 2026
Contributor
- 使用有界搜索替换前进循环,避免短缓冲区导致的UI冻结
- 采用rfind方法查找最后的转义序列而不是循环查找
- 防止索引计算错误导致的GIL占用和界面无响应问题
- 优化了尾部窗口中ANSI转义码的处理逻辑
- 使用有界搜索替换前进循环,避免短缓冲区导致的UI冻结 - 采用rfind方法查找最后的转义序列而不是循环查找 - 防止索引计算错误导致的GIL占用和界面无响应问题 - 优化了尾部窗口中ANSI转义码的处理逻辑
There was a problem hiding this comment.
🟢 Approval recommended
The bounded search correctly removes the infinite-loop condition without changing the intended buffering behavior.
0 open findings
What changed in this PR
Fixes a UI freeze caused by an infinite ANSI escape-sequence search loop in the debug plugin.
Changes:
- Replaces the advancing loop with a bounded
rfind. - Preserves incomplete ANSI sequences for subsequent processing.
| File | Description |
|---|---|
COMTool/plugins/dbg.py |
Safely locates the final ANSI escape sequence in the tail buffer. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.