feat(Pane[capture_pane]) Support new capture-pane flags#614
Merged
Conversation
why: Expose more tmux capture-pane capabilities for advanced use cases like capturing colored output, handling wrapped lines, and controlling trailing space behavior. what: - Add escape_sequences parameter (-e flag) for ANSI escape sequences - Add escape_non_printable parameter (-C flag) for octal escapes - Add join_wrapped parameter (-J flag) for joining wrapped lines - Add preserve_trailing parameter (-N flag) for trailing spaces - Add trim_trailing parameter (-T flag) with tmux 3.4+ version check - Issue warning when trim_trailing used with tmux < 3.4
why: Ensure comprehensive coverage of all capture_pane() flag combinations with parametrized test cases. what: - Add CapturePaneCase NamedTuple for test case definitions - Add 16 parametrized test cases covering all flag variations - Add backward compatibility test for existing code - Add start/end parameters test with new flags - Add trim_trailing warning test for tmux version check - Use marker-based completion detection for reliability
3e43532 to
2b5dd49
Compare
why: Document the new capture_pane() parameters for the changelog. what: - Add section for Pane.capture_pane() enhanced - Document all 5 new parameters with flag mappings - Add code examples for colored output and joined lines - Note trim_trailing requires tmux 3.4+
why: Provide practical examples for the new capture_pane() parameters in the pane interaction topic documentation. what: - Add section for capturing ANSI escape sequences - Add section for joining wrapped lines - Add section for preserving trailing spaces - Add capture flags summary table - Add note about trim_trailing tmux 3.4+ requirement
2b5dd49 to
279b6d4
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #614 +/- ##
==========================================
+ Coverage 45.34% 45.68% +0.34%
==========================================
Files 22 22
Lines 2236 2250 +14
Branches 354 360 +6
==========================================
+ Hits 1014 1028 +14
Misses 1079 1079
Partials 143 143 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Member
Author
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. 🤖 Generated with Claude Code |
capture-pane flags
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pane.capture_pane() enhanced (#614)
The {meth}
~libtmux.pane.Pane.capture_panemethod now supports 5 new parametersthat expose additional tmux
capture-paneflags:escape_sequences-eescape_non_printable-C\xxxjoin_wrapped-Jpreserve_trailing-Ntrim_trailing-TCapturing colored output:
Joining wrapped lines:
Version compatibility:
The
trim_trailingparameter requires tmux 3.4+. If used with an older version,a warning is issued and the flag is ignored. All other parameters work with
libtmux's minimum supported version (tmux 3.2a).