Skip to content

Conversation

@tony
Copy link
Member

@tony tony commented Nov 29, 2025

Drop support for tmux versions < 3.2

Summary

This PR removes support for tmux versions older than 3.2a, simplifying the
codebase by removing version conditionals, guards, and workarounds that are
no longer needed.

Breaking Change: libtmux now requires tmux 3.2a or later. Users on older
tmux versions should use libtmux v0.48.x.

Changes

Core Changes

  • Bump TMUX_MIN_VERSION from 1.8 to 3.2a
  • Remove CI testing for tmux versions < 3.2

Code Simplification

  • server.py: Remove pre-3.2 version guards
  • session.py: Remove pre-3.2 version guards and conditionals
  • window.py: Remove pre-3.2 version guards
  • pane.py: Remove pre-3.2 version guards
  • common.py: Simplify error handling, update docstring examples
  • neo.py: Remove QUIRK_TMUX_3_1_X_0001 workaround
  • exc.py: Clean up outdated version references in docstrings

Test Cleanup

  • Remove version-conditional test logic across all test files
  • Simplify test assertions that no longer need version checks
  • Remove tests that only applied to older tmux versions

Documentation

  • Update README.md with new requirements and backport info
  • Update quickstart.md with new tmux version requirements
  • Add CHANGES entry documenting the version bump

Migration

Users on tmux < 3.2a should pin to libtmux v0.48.x:

pip install 'libtmux<0.49'

tony added 10 commits November 29, 2025 13:20
why: Minimum supported tmux version is now 3.2a, older versions
no longer need CI coverage.
what:
- Remove tmux 2.6, 2.7, 2.8, 3.0a, 3.1b from version matrix
- Keep 3.2a through master for testing
why: tmux versions below 3.2a are no longer supported as of libtmux 0.49.0
what:
- Change TMUX_MIN_VERSION from "1.8" to "3.2a"
- Remove TMUX_SOFT_MIN_VERSION constant (no longer needed)
- Remove _version_deprecation_checked flag
- Remove _check_deprecated_version() function
- Remove deprecation warning call from get_version()
- Update has_minimum_version() docstring to reflect 3.2a requirement
- Update error message to mention v0.48.x backport
why: tmux >= 3.2a is now required, these version checks are unnecessary
what:
- Remove has_gte_version("2.1") check in has_session() - always prepend = for exact match
- Remove has_gte_version("3.2") check in new_session() - always pass -e environment flags
- Remove has_gte_version import (no longer used)
why: tmux >= 3.2a is now required, these version checks are unnecessary
what:
- Remove has_version("2.7") BSD error workaround in rename_session()
- Remove has_gte_version("3.0") check in new_window() - always pass -e environment flags
- Remove has_gte_version("3.2") check for direction flags - always pass direction
- Remove has_gte_version("3.2") check for target_window - always use target
- Remove version skip comment from doctest examples
- Remove unused has_gte_version and has_version imports
why: tmux >= 3.2a is now required, version guards for older tmux are unnecessary.
what:
- Remove has_gte_version("2.9") check in resize() - resize is always available
- Remove doctest version skip block
- Remove unused has_gte_version import
why: tmux >= 3.2a is now required, version guards for older tmux are unnecessary.
what:
- Remove has_gte_version("3.1") percentage checks in resize() - percentages always allowed
- Remove has_lt_version("3.1") size flag branching in split() - always use -l flag
- Remove has_gte_version("3.0") environment check in split() - -e flag always available
- Simplify nested if statements after removing version checks
- Remove unused has_gte_version, has_lt_version imports
why: tmux >= 3.2a is now required, version conditionals are unnecessary.
what:
- Remove has_gte_version("3.2") conditionals for pane_start_command format
- Mark test_new_session_width_height as skip (always skipped on 3.2+, needs rework)
- Remove has_gte_version("3.2") check from test_new_session_environmental_variables
- Remove unused has_gte_version, has_version imports
why: tmux >= 3.2a is now required, version conditionals are unnecessary.
what:
- Remove has_gte_version("2.1") from test_has_session - exact match always works
- Simplify test_show_option_unknown - always expect InvalidOption
- Simplify test_set_option_invalid - always expect InvalidOption
- Remove skip from test_new_window_with_environment - -e flag always available
- Delete test_new_window_with_environment_logs_warning_for_old_tmux (dead code)
- Remove skip from test_session_new_window_with_direction - direction flags always work
- Delete test_session_new_window_with_direction_logs_warning_for_old_tmux (dead code)
- Remove unused has_gte_version, has_lt_version imports
why: tmux >= 3.2a is now required, version conditionals are unnecessary.
what:
- Simplify test_split_shell pane_start_command check - always quote format
- Simplify test_split_size - always use modern -l flag
- Simplify test_set_show_window_options - pane-border-format always available
- Simplify test_show_window_option_unknown - always expect InvalidOption
- Simplify test_set_window_option_invalid - always expect InvalidOption
- Remove skip from test_empty_window_name - filter flag always available
- Remove skip from test_split_with_environment - -e flag always available
- Remove skip from test_split_window_zoom - -Z flag always available
- Delete test_split_with_environment_logs_warning_for_old_tmux (dead code)
- Remove skip from test_resize - resize-window always available
- Remove skip from test_new_window_with_direction - direction flags always work
- Delete test_new_window_with_direction_logs_warning_for_old_tmux (dead code)
- Remove unused has_gte_version, has_lt_version, has_lte_version imports
why: tmux >= 3.2a is now required, version conditionals are unnecessary.
what:
- Remove skip from test_pane_split_window_zoom - -Z flag always available
- Remove skip from test_resize_pane - resize-pane always available
- Remove has_gte_version("3.1") percentage branching in test_resize_pane
- Simplify test_split_pane_size - always use modern path
- Remove unused has_gte_version, has_lt_version, has_lte_version imports
@tony tony force-pushed the drop-old-tmux-versions-pt2 branch from 364a2be to 3446043 Compare November 29, 2025 19:53
@codecov
Copy link

codecov bot commented Nov 29, 2025

Codecov Report

❌ Patch coverage is 64.70588% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 46.77%. Comparing base (60a2188) to head (a145e7f).
⚠️ Report is 20 commits behind head on master.

Files with missing lines Patch % Lines
src/libtmux/pane.py 42.85% 2 Missing and 2 partials ⚠️
src/libtmux/common.py 50.00% 1 Missing ⚠️
src/libtmux/session.py 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #608      +/-   ##
==========================================
- Coverage   47.59%   46.77%   -0.82%     
==========================================
  Files          18       18              
  Lines        1748     1708      -40     
  Branches      293      277      -16     
==========================================
- Hits          832      799      -33     
+ Misses        803      799       -4     
+ Partials      113      110       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

tony added 3 commits November 29, 2025 13:57
why: Drop support for tmux versions older than 3.2
what:
- test_session.py: Remove has_gte_version/has_lt_version imports and guards
- test_session.py: Simplify option error tests to always expect InvalidOption
- test_session.py: Remove environment warning test for old tmux
- test_window.py: Remove has_gte_version/has_lt_version imports
- test_window.py: Simplify pane_start_command and size tests
- test_window.py: Simplify option tests to always expect InvalidOption
- test_window.py: Remove skipif decorators for 3.0/3.2 features
- test_window.py: Remove environment warning test for old tmux
why: Drop support for tmux versions older than 3.2
what:
- Remove "(recommended)" qualifier since 3.2a is now required
- Remove deprecation notice for tmux 1.8-3.1
why: Clarify backport branches for legacy support
what:
- Rename "Python support" section to "Backports"
- Make tmux version range explicit (1.8 to 3.1c)
- Reorder items chronologically (Python 2.x, then tmux)
@tony tony force-pushed the drop-old-tmux-versions-pt2 branch from 991edf1 to 0147bce Compare November 29, 2025 20:43
@tony tony marked this pull request as ready for review November 29, 2025 20:49
@tony
Copy link
Member Author

tony commented Nov 29, 2025

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

tony added a commit that referenced this pull request Nov 29, 2025
why: Clean up docstrings/comments referencing old tmux versions now that 3.2a is minimum
what:
- common.py: Update error message, simplify handle_option_error docstring
- server.py: Remove "tmux 2.1 and up only" from exact param, remove 1.9-dev comment
- session.py: Remove "(tmux 3.2+)" from direction param, remove 1.9-dev comment
- window.py: Remove "tmux 3.0+ only" from environment param, update deprecation msg
- pane.py: Remove "tmux 3.0+ only" from environment params, remove 1.9-dev comment
- neo.py: Remove QUIRK_TMUX_3_1_X_0001 documentation (no longer applicable)
- Update test assertions for new error message
tony added 2 commits November 29, 2025 15:28
why: Clean up docstrings/comments referencing old tmux versions now that 3.2a is minimum
what:
- common.py: Update error message, simplify handle_option_error docstring
- server.py: Remove "tmux 2.1 and up only" from exact param, remove 1.9-dev comment
- session.py: Remove "(tmux 3.2+)" from direction param, remove 1.9-dev comment
- window.py: Remove "tmux 3.0+ only" from environment param, update deprecation msg
- pane.py: Remove "tmux 3.0+ only" from environment params, remove 1.9-dev comment
- neo.py: Remove QUIRK_TMUX_3_1_X_0001 documentation (no longer applicable)
- Update test assertions for new error message
why: Document breaking change for v0.49.x release
what:
- Add Breaking Changes section for 0.49.x
- Document removal of tmux 1.8 to 3.1c support
- Note removal of TMUX_SOFT_MIN_VERSION and deprecation system
- Point users to v0.48.x backport branch
@tony tony force-pushed the drop-old-tmux-versions-pt2 branch from 1704f5d to 07ba797 Compare November 29, 2025 21:28
tony added 4 commits November 29, 2025 15:55
…ditional

why: tmux >= 3.2a is now required, making the conditional always true
what:
- Remove has_gte_version("3.2") check in test_new_session_shell
- Remove unused has_gte_version import
why: Examples should reflect current minimum version (3.2a)
what:
- Update has_version, has_gt_version, has_gte_version docstring examples
- Update has_lte_version, has_lt_version docstring examples
- Change '1.8' to '3.2a' in all version comparison function docs
why: Comment about tmux < 1.7 irrelevant with 3.2a minimum
what:
- Remove "tmux < 1.7. This is added in 1.7." comment from split()
why: Version introduction info irrelevant with 3.2a minimum
what:
- Remove "introduced in tmux v2.4" from InvalidOption docstring
@tony tony merged commit 9c26976 into master Nov 29, 2025
14 checks passed
@tony tony deleted the drop-old-tmux-versions-pt2 branch November 29, 2025 22:20
@tony tony changed the title Drop tmux < 3.2 Drop support for tmux versions < 3.2 Nov 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants