[BUG] Ctrl+O verbose mode does not expand truncated Bash tool input/output for python commands
Bug Description
When Claude Code runs a Bash command involving python3, both the command input and output are truncated in the TUI display, and Ctrl+O verbose mode does not expand either. The output still shows "+ N lines (ctrl+o to expand)" even when already in Ctrl+O verbose mode. This appears to be specific to python — other languages like Ruby and tools like gh display fully at similar lengths.
Steps to Reproduce
- Start Claude Code 2.1.45
- Ask it to run an inline python script:
````
python3 -c "import random; nums = [random.randint(1, 50) for _ in range(100)]; unique = set(nums); print(f'Total: {len(nums)}'); print(f'Unique: {len(unique)}'); print(f'Min: {min(nums)}'); print(f'Max: {max(nums)}'); print(f'Duplicates: {len(nums) - len(unique)}'); print(f'Mean: {sum(nums) / len(nums):.1f}'); print(f'Sorted unique: {sorted(unique)}'); print(f'First 10: {nums[:10]}'); print(f'Last 10: {nums[-10:]}')"
- Press Ctrl+O to toggle verbose mode
- The display shows (even after Ctrl+O):
````
Bash(python3 -c "import random; ... print(f'Unique:
{len(unique)}'); prin…)
⎿ Total: 100
Unique: 46
Min: 1
… +7 lines (ctrl+o to expand)
Both the command input is truncated AND the output still says "ctrl+o to expand" despite already being in verbose mode.
- Run the equivalent in Ruby at the same length:
````
ruby -e "nums = (1..100).map { rand(1..50) }; unique = nums.uniq; puts \"Total: #{nums.length}\"; puts \"Unique: #{unique.length}\"; puts \"Min: #{nums.min}\"; puts \"Max: #{nums.max}\"; puts \"Duplicates: #{nums.length - unique.length}\"; puts \"Mean: #{(nums.sum.to_f / nums.length).round(1)}\"; puts \"Sorted unique: #{unique.sort}\"; puts \"First 10: #{nums[0..9]}\"; puts \"Last 10: #{nums[-10..-1]}\""
- The Ruby command displays fully (both input and output) with Ctrl+O.
Also tested
echo "..." | python3— also truncated- Multi-line
python3 -cwith newlines — also truncated gh api ...with similar length — displays fully- Both with and without permission prompts — no difference
Expected Behavior
Ctrl+O should expand both the full command input and output regardless of the command being run.
Actual Behavior
Python commands have both input and output permanently truncated. The output section still prompts "ctrl+o to expand" even when already in verbose mode.
Environment
- Claude Code version: 2.1.45
- Platform: macOS (Darwin 25.2.0)
- Terminal: default zsh
Notes
- This works correctly in 2.1.39 — Ctrl+O expands the full command input and output for python commands
- This is a regression introduced somewhere between 2.1.39 and 2.1.45
🤖 Generated with Claude Code
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗