Skip to content

fix(dbg): 修复调试插件中的无限循环问题 - #197

Merged
Neutree merged 1 commit into
Neutree:masterfrom
diqiu114:fix/dbg-infinite-loop
Oct 9, 2026
Merged

Neutree merged 1 commit into
Neutree:masterfrom
diqiu114:fix/dbg-infinite-loop

Conversation

@diqiu114

@diqiu114 diqiu114 commented Oct 9, 2026

Copy link
Copy Markdown
Contributor
  • 使用有界搜索替换前进循环,避免短缓冲区导致的UI冻结
  • 采用rfind方法查找最后的转义序列而不是循环查找
  • 防止索引计算错误导致的GIL占用和界面无响应问题
  • 优化了尾部窗口中ANSI转义码的处理逻辑

- 使用有界搜索替换前进循环,避免短缓冲区导致的UI冻结
- 采用rfind方法查找最后的转义序列而不是循环查找
- 防止索引计算错误导致的GIL占用和界面无响应问题
- 优化了尾部窗口中ANSI转义码的处理逻辑

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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.

@Neutree
Neutree merged commit 8dbf97d into Neutree:master Oct 9, 2026
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.

3 participants