Libtmux

Latest version: v0.46.1

Safety actively analyzes 722491 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 18

0.46.0

from libtmux.test import (
RETRY_INTERVAL_SECONDS,
RETRY_TIMEOUT_SECONDS,
TEST_SESSION_PREFIX
)


python
From 0.46.0 onward
from libtmux.test.constants import (
RETRY_INTERVAL_SECONDS,
RETRY_TIMEOUT_SECONDS,
TEST_SESSION_PREFIX
)


Development

Test helpers: Increased coverage (580)

Several improvements to the test helper modules:

- Enhanced `EnvironmentVarGuard` in `libtmux.test.environment` to better handle variable cleanup
- Added comprehensive test suites for test constants and environment utilities
- Improved docstrings and examples in `libtmux.test.random` with test coverage annotations
- Fixed potential issues with environment variable handling during tests
- Added proper coverage markers to exclude type checking blocks from coverage reports

0.45.0

from libtmux.test.constants import TEST_SESSION_PREFIX
from libtmux.test.environment import EnvironmentVarGuard
from libtmux.test.random import get_test_session_name, get_test_window_name, namer
from libtmux.test.temporary import temp_session, temp_window


Development

- CI: Check for runtime dependencies (574)

Kudos ppentchev for inspiration on the command
([comment](https://github.com/tmux-python/libtmux/pull/572#issuecomment-2663642923)).

0.44.2

Bug fix

- Fix `typing_extensions` issue by wrapping it in `TYPE_CHECKING`, continuation of 564, via 572.

Development

- Improved test organization and coverage in `test_common.py` (570):
- Consolidated version-related tests into parametrized fixtures using NamedTuples
- Added comprehensive test cases for various version formats (master, next, OpenBSD, dev, rc)
- Improved test readability with clear test IDs and logical grouping
- Consistent use of pytest parametrize convention across test suite
- Fix broken test for `test_window_rename` (570)

0.44.1

Packaging

- Types: Only import `typing_extensions` when necessary, via 563, ppentchev!

0.44.0

New Features

Context Managers support (566)

Added context manager support for all major object types:

- `Server`: Automatically kills the server when exiting the context
- `Session`: Automatically kills the session when exiting the context
- `Window`: Automatically kills the window when exiting the context
- `Pane`: Automatically kills the pane when exiting the context

Example usage:

python
with Server() as server:
with server.new_session() as session:
with session.new_window() as window:
with window.split() as pane:
pane.send_keys('echo "Hello"')
Do work with the pane
Everything is cleaned up automatically when exiting contexts


This makes it easier to write clean, safe code that properly cleans up tmux resources.

0.43.0

New Features

Server Initialization Callbacks

Server now accepts 2 new optional params, `socket_name_factory` and `on_init` callbacks (565):

- `socket_name_factory`: Callable that generates unique socket names for new servers
- `on_init`: Callback that runs after server initialization
- Useful for creating multiple servers with unique names and tracking server instances
- Socket name factory is tried after socket_name, maintaining backward compatibility

New test fixture: `TestServer`

Add `TestServer` pytest fixture for creating temporary tmux servers (565):

- Creates servers with unique socket names that clean up after themselves
- Useful for testing interactions between multiple tmux servers
- Includes comprehensive test coverage and documentation
- Available in doctest namespace

Documentation

- Fix links to the "Topics" section
- More docs for "Traversal" Topic (567)

Page 1 of 18

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.