Commit 3eef36e
committed
fix(ControlMode): handle -P flag output with % prefix correctly
Root Cause:
- tmux pane IDs use format %N (like %0, %1, %2, %3)
- When split-window -P -F#{pane_id} outputs "%3", it's sent INSIDE
the %begin/%end command block
- But because it starts with %, the protocol parser treated it as
a control message/notification, NOT as stdout content
- Result: pane_cmd.stdout was empty, causing IndexError
The Fix:
- Modified _handle_percent_line() to check parser state
- When IN_COMMAND state, lines starting with % that aren't known
control messages (%begin, %end, %error) are now treated as stdout
- This correctly captures pane/window/session IDs from -P flag
Impact:
- Fixed 62 of 82 test failures (76% reduction)
- Before: 82 failed, 512 passed
- After: 20 failed, 574 passed
- All split/resize/pane operations now work correctly
Remaining Issues:
- capture-pane -p still has issues (different root cause)
- Environment variable passing needs investigation
- Session name validation edge cases
- Some doctests need updates
Verification:
Confirmed with debug logging that %3␞ was being sent inside command
block but incorrectly routed to notification handler instead of stdout.
Related: #6051 parent 8257caa commit 3eef36e
1 file changed
+6
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
191 | 197 | | |
192 | 198 | | |
193 | 199 | | |
| |||
0 commit comments