Skip to content

API additions for tmuxinator/teamocil parity#636

Open
tony wants to merge 4 commits intomasterfrom
parity
Open

API additions for tmuxinator/teamocil parity#636
tony wants to merge 4 commits intomasterfrom
parity

Conversation

@tony
Copy link
Member

@tony tony commented Mar 7, 2026

Summary

Three non-breaking API additions to support tmuxp's feature parity with tmuxinator (3.3.7) and teamocil (1.4.2).

Closes #635. Tracking: tmux-python/tmuxp#1016

  • Pre-execution command logging: tmux_cmd now logs the command before execution via logger.debug, enabling future dry-run mode in tmuxp (tmuxinator's debug / teamocil's --debug)
  • Pane.set_title(): Wraps select-pane -T and enables pane_title format variable. Uncomments pane_title in formats.py, adds field to neo.Obj, adds Pane.set_title() method and Pane.title property alias
  • Configurable tmux binary path: Server(tmux_bin="/path/to/tmux") threads through Server.cmd(), Server.raise_if_dead(), and neo.fetch_objs(). Supports wemux, byobu, or custom-built tmux binaries (tmuxinator's tmux_command equivalent)

All changes are fully backward-compatible — new parameters default to existing behavior.

Test plan

  • All 884 existing tests pass
  • New tests for pre-execution logging (test_tmux_cmd_pre_execution_logging)
  • New tests for set_title with plain text and special characters
  • New tests for tmux_bin default, custom path, and invalid path
  • Doctests pass for Pane.set_title() and Pane.title
  • mypy clean, ruff clean

tony added a commit that referenced this pull request Mar 7, 2026
why: Document the three new features for the upcoming release.
what:
- Pane.set_title() and pane_title support
- Configurable tmux binary path (Server tmux_bin parameter)
- Pre-execution command logging in tmux_cmd
@codecov
Copy link

codecov bot commented Mar 7, 2026

Codecov Report

❌ Patch coverage is 56.52174% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 45.60%. Comparing base (6fcd92a) to head (121d055).

Files with missing lines Patch % Lines
src/libtmux/pane.py 44.44% 4 Missing and 1 partial ⚠️
src/libtmux/server.py 57.14% 2 Missing and 1 partial ⚠️
src/libtmux/common.py 80.00% 1 Missing ⚠️
src/libtmux/neo.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #636      +/-   ##
==========================================
+ Coverage   45.48%   45.60%   +0.11%     
==========================================
  Files          22       22              
  Lines        2260     2274      +14     
  Branches      361      362       +1     
==========================================
+ Hits         1028     1037       +9     
- Misses       1085     1089       +4     
- Partials      147      148       +1     

☔ 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 4 commits March 6, 2026 19:55
why: tmux_cmd logs stdout after execution and exceptions, but never logs
the command before execution. Pre-execution logging is the prerequisite
for a future dry-run mode in tmuxp (tmuxinator's debug / teamocil's
--debug equivalent).
what:
- Add logger.debug call before subprocess.Popen in tmux_cmd.__init__
- Add test verifying pre-execution log message contains command
why: tmux supports select-pane -T and #{pane_title} (since 2.6).
tmuxinator uses this for named panes. libtmux had no wrapper and
pane_title was commented out of formats.py.
what:
- Uncomment pane_title in formats.py PANE_FORMATS list
- Add pane_title field to neo.Obj dataclass
- Add Pane.set_title() method using select-pane -T
- Add Pane.title property alias for pane_title
- Add tests for set_title with plain and special characters
why: shutil.which("tmux") is hardcoded in tmux_cmd and Server. No way
to use wemux, byobu, or a custom-built tmux. tmuxinator supports
tmux_command config key including wemux module.
what:
- Add tmux_bin keyword arg to tmux_cmd.__init__ (backward compatible)
- Add tmux_bin parameter to Server.__init__ with pathlib.Path support
- Thread tmux_bin through Server.cmd(), Server.raise_if_dead(), and
  neo.fetch_objs()
- Session/Window/Pane inherit via server.cmd() delegation
- Add tests for default, custom path, and invalid path scenarios
why: Document the three new features for the upcoming release.
what:
- Pane.set_title() and pane_title support
- Configurable tmux binary path (Server tmux_bin parameter)
- Pre-execution command logging in tmux_cmd
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.

API additions for tmuxinator/teamocil parity

1 participant