Commit b5bd00d
committed
fix(tools): Use ␞ (U+241E) as snapshot_pane delimiter, matching libtmux's FORMAT_SEPARATOR
why: The earlier delimiter fix picked `\t` on the theory that tmux
always passes tabs through verbatim. That's true but incomplete:
tabs are also legal (if rare) in Linux paths, so a pane_current_path
containing a tab would still silently shift the parsed fields. And
while researching which tmux versions escape ASCII control chars
like 0x1f, the clean answer emerged from libtmux itself: since
commit f88d28f2 (Jan 2023) libtmux has used the printable Unicode
glyph `␞` (U+241E, "SYMBOL FOR RECORD SEPARATOR") as FORMAT_SEPARATOR
for exactly this class of parsing.
Two independent reasons ␞ is strictly safer than `\t`:
1. tmux's utf8_strvis (utf8.c:663-675) explicitly copies valid
UTF-8 multi-byte sequences verbatim, bypassing the vis()
escape that turns ASCII control chars into octal strings. `␞`
is a valid 3-byte UTF-8 sequence (0xe2 0x90 0x9e), so no tmux
version — stable, alpha, or master — can escape it through the
control-char path that broke `\x1f` on CI.
2. `␞` is a printable Unicode symbol that realistically cannot
appear in a pane title, a running command name, or a
filesystem path. That gives us immunity to the tab-in-path
vulnerability that `\t` doesn't have.
This is the same delimiter libtmux uses internally for every
object's format parsing, tested across every tmux version in the
libtmux CI matrix for multiple years. We gain the same coverage
for free.
what:
- Switch _SEP in snapshot_pane from "\t" to "␞".
- Update the inline comment to cite utf8_strvis + libtmux's
FORMAT_SEPARATOR as the rationale.
- Update the monkeypatched fake_cmd in
test_snapshot_pane_pads_short_display_message_output to split /
rejoin on "␞".
- Defensive padding retained unchanged.
This supersedes the `\t` choice from the immediately-prior fix
commit; that commit's defensive-padding contribution remains the
load-bearing anti-IndexError guarantee. Verified locally against
tmux 3.6a. Expected to clear the CI matrix failures on 3.2a, 3.3a,
3.4, 3.5, 3.6 stable, and master.1 parent cff037c commit b5bd00d
2 files changed
Lines changed: 13 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
670 | 670 | | |
671 | 671 | | |
672 | 672 | | |
673 | | - | |
674 | | - | |
675 | | - | |
676 | | - | |
677 | | - | |
678 | | - | |
679 | | - | |
680 | | - | |
681 | | - | |
682 | | - | |
683 | | - | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
684 | 684 | | |
685 | 685 | | |
686 | 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