Repository navigation
neo(fix[parse_output]): Keep empty tmux fields as empty strings - #900
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #900 +/- ##
==========================================
- Coverage 57.71% 57.58% -0.13%
==========================================
Files 29 29
Lines 4363 4362 -1
Branches 882 882
==========================================
- Hits 2518 2512 -6
- Misses 1535 1539 +4
- Partials 310 311 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
tony
force-pushed
the
fix/445-empty-string-fields
branch
2 times, most recently
from
November 21, 2026 22:09
51e68f3 to
d63e4d9
Compare
tony
force-pushed
the
fix/445-empty-string-fields
branch
4 times, most recently
from
November 22, 2026 19:27
cc91ec9 to
6cae484
Compare
tony
force-pushed
the
fix/445-empty-string-fields
branch
from
November 25, 2026 08:13
6cae484 to
37c1c6c
Compare
tony
added a commit
that referenced
this pull request
Nov 26, 2026
…note Update Session, Window, and Pane class docstrings so '' vs None matches parse_output(), add a tested MIGRATION entry for #900, and drop the duplicate TYPE_CHECKING guard in tests/test_neo.py.
why: parse_output dropped every empty value, so a field tmux reports as empty read as None, the same as a field tmux was never asked for, and refresh() kept the old value of a field tmux had emptied. what: - Return every requested field from parse_output, "" when empty - Test a cleared pane title after refresh() and on a new object - Update the parse_output doctest
why: An empty field and a field tmux was never asked for both read as None, and callers need to know the first now reads as "". what: - Add a Breaking changes entry for empty fields, with the migration
…note Update Session, Window, and Pane class docstrings so '' vs None matches parse_output(), add a tested MIGRATION entry for #900, and drop the duplicate TYPE_CHECKING guard in tests/test_neo.py.
tony
force-pushed
the
fix/445-empty-string-fields
branch
from
November 27, 2026 01:20
3114b9d to
30a010f
Compare
7 tasks done
tony
added a commit
to tmux-python/tmuxp
that referenced
this pull request
Nov 28, 2026
why: Pick up libtmux 0.69.0. Server context managers leave a running tmux server alive on exit unless kill_on_exit=True is set, @ user options stay strings in show_option() and show_options(), and empty tmux format fields hydrate as "" instead of None while unset fields stay None. tmuxp requires no source changes for the upgrade. what: - Bump libtmux ~=0.68.0 -> ~=0.69.0 in pyproject.toml - Update uv.lock to libtmux 0.69.0 from PyPI (only libtmux moves) libtmux 0.69.0 (2026-11-27): - Server.__exit__() preserves running servers unless kill_on_exit=True is set (tmux-python/libtmux#728) - @ user options stay strings in show_option() and show_options() (tmux-python/libtmux#826) - Empty tmux format fields hydrate as "" while unset fields stay None (tmux-python/libtmux#900) See also: - https://github.com/tmux-python/libtmux/releases/tag/v0.69.0 - https://libtmux.git-pull.com/history/#libtmux-0-69-0-2026-11-27
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.
Summary
""inparse_output()instead of dropping them toNone.NoneonObjfields for format tokens not requested by the listing command or running tmux version.Session,Window, andPanefield docstrings and document the migration inCHANGESandMIGRATION.Fixes #445
Before / After
Before, a cleared or empty format token such as
pane_titleorsession_groupread back asNone:After, requested tokens that tmux reports as empty read back as
"", so emptiness checks use truthiness (not pane.pane_title):Design decisions
Nonenow has one meaning onObjinstances: the token was not requested (for example a client-only token onlist-sessions, or a token gated on a newer tmux release than the connected server). An empty answer from tmux is"", matching tmux's own format expansion informat.c.value is Nonefor empty string tokens (pane_title,session_group,pane_dead_status,window_name) switch tonot value.Test plan
test_empty_field_is_an_empty_stringandtest_refresh_clears_a_field_tmux_emptiedverify""on freshPane.from_pane_id()reads and afterrefresh()parse_outputandMIGRATIONdoctests verify requested empty fields ("") vs unrequested fields (None)ruff check,ruff format --check,mypy, andsphinx-build -W