权限确认弹窗渲染超长命令导致终端卡死

Resolved 💬 3 comments Opened Apr 16, 2026 by zyue0956-bit Closed Apr 19, 2026

Bug Description

When a sub-agent executes a Bash command with very large content (e.g., a Python script that writes an entire HTML file inline), the permission confirmation popup renders the full command text in the terminal. This causes the terminal to freeze/become unresponsive — the user cannot scroll, confirm, or dismiss the dialog.

Steps to Reproduce

  1. Launch a sub-agent that generates a large file (e.g., an HTML file with ~500+ lines)
  2. The agent uses a Bash command like python3 << 'PYEOF' ... PYEOF with the entire file content inline
  3. The permission popup appears, rendering all content
  4. Terminal becomes unresponsive / extremely laggy

Expected Behavior

  • Long commands should be truncated in the permission preview (e.g., show first 50-100 lines with a "... truncated" indicator)
  • Or show a summary (e.g., "Run python3 script (2847 chars)") with an option to expand

Actual Behavior

The full command is rendered in the permission popup, freezing the terminal. User has to press Esc (if responsive) or Ctrl+C to recover.

Environment

  • macOS
  • Claude Code (latest)

Screenshot

The permission popup rendering thousands of characters of inline HTML/Python code, making the terminal unusable.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗