Download Latest Version v0.53.0 - Bug fixes source code.tar.gz (410.4 kB)
Email in envelope

Get an email when there's a new version of libtmux

Home / v0.52.0
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2025-12-07 1.5 kB
v0.52.0 - _send_keys()_ updates source code.tar.gz 2025-12-07 409.1 kB
v0.52.0 - _send_keys()_ updates source code.zip 2025-12-07 463.1 kB
Totals: 3 Items   873.7 kB 0

libtmux 0.52.0

capture_pane() enhancements

The Pane.capture_pane() method now supports 5 new parameters exposing additional tmux capture-pane flags:

Parameter tmux Flag Description
escape_sequences -e Include ANSI escape sequences (colors, attributes)
escape_non_printable -C Escape non-printable chars as octal \xxx
join_wrapped -J Join wrapped lines back together
preserve_trailing -N Preserve trailing spaces at line ends
trim_trailing -T Trim trailing empty positions (tmux 3.4+)

Examples

Capturing colored output:

:::python
# Capture with ANSI escape sequences preserved
pane.send_keys('printf "\\033[31mRED\\033[0m"', enter=True)
output = pane.capture_pane(escape_sequences=True)
# Output contains: '\x1b[31mRED\x1b[0m'

Joining wrapped lines:

:::python
# Long lines that wrap are joined back together
output = pane.capture_pane(join_wrapped=True)

Version compatibility

The trim_trailing parameter 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).

What's Changed

Full Changelog: https://github.com/tmux-python/libtmux/compare/v0.51.0...v0.52.0

Source: README.md, updated 2025-12-07