Commit 8956288
committed
fix(tools): Revert snapshot_pane delimiter to tab, keep defensive padding
why: CI exposed that tmux's display-message output C-escapes non-tab
ASCII control characters. What I expected to be a single 0x1f byte
arrived as the literal 4-character string "\037", producing a single
joined parts[0] value that contained every embedded "\037". The
first int() conversion then blew up with:
ValueError: invalid literal for int() with base 10:
'0\\0370\\03780\\03724\\0370\\037...'
Six of seven CI tmux versions (3.2a, 3.3a, 3.4, 3.5, 3.6, master)
escape on output; local tmux 3.6a does not. The "defense in depth"
delimiter choice in the earlier snapshot_pane hardening commit
traded a rare hazard (tabs in pane_title, which tmux's `select-pane
-T` silently rejects anyway) for a guaranteed one (control-char
escaping in display-message output) and broke every CI matrix run.
The defensive padding remains the genuinely load-bearing part of
the earlier hardening and is retained verbatim.
what:
- Switch _SEP in snapshot_pane from "\x1f" back to "\t".
- Keep the defensive `(raw.split(_SEP) + [""] * 11)[:11]` padding
so snapshot_pane still degrades gracefully when tmux emits fewer
format fields than expected.
- Update the inline comment to explain the real constraint: tabs
survive display-message verbatim, other control chars do not,
and tmux rejects tabs in pane_title so the tab-in-title risk is
purely theoretical.
- Update the monkeypatched fake_cmd in
test_snapshot_pane_pads_short_display_message_output to split /
rejoin on "\t" to match the new delimiter.
Verified locally: all four tests that failed on CI
(test_snapshot_pane, test_snapshot_pane_cursor_moves,
test_snapshot_pane_pads_short_display_message_output,
test_enter_and_exit_copy_mode) now pass.1 parent d2f6ca0 commit 8956288
2 files changed
Lines changed: 13 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
670 | 670 | | |
671 | 671 | | |
672 | 672 | | |
673 | | - | |
674 | | - | |
675 | | - | |
676 | | - | |
677 | | - | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
678 | 684 | | |
679 | 685 | | |
680 | 686 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
584 | 584 | | |
585 | 585 | | |
586 | 586 | | |
587 | | - | |
588 | | - | |
| 587 | + | |
| 588 | + | |
589 | 589 | | |
590 | 590 | | |
591 | 591 | | |
| |||
0 commit comments