libtmux
libtmux copied to clipboard
Missing `TmuxObjectDoesNotExist` and silent stderr on closed targets
Summary
In 0.8.x, acting on a manually closed pane or window raised IndexError: list index out of range inside _info. On the Obj dataclass hierarchy (v0.62.0), IndexError is gone, but closed-target failures remain inconsistent across methods:
Pane.capture_pane(src/libtmux/pane.pyline 670) andPane.send_keys(src/libtmux/pane.pyline 828) do not callraise_if_stderr, silently returning[]orNonewhentmuxreportscan't find pane: %N.Obj._refresh(src/libtmux/neo.pyline 524) executesassert obj is not None, raisingAssertionError(or silently no-opping underpython -O) when the target pane, window, or session was closed.- Methods that call
raise_if_stderr(such asWindow.killandPane.kill) raise bareLibTmuxExceptionrather thanTmuxObjectDoesNotExistwhen_is_target_not_found_errormatchescan't find ....
Expected
Operations on a closed pane, window, or session raise TmuxObjectDoesNotExist (a LibTmuxException subclass) rather than silently discarding can't find ... stderr or failing an assert.
References
_is_target_not_found_errorclassifier added in #713:src/libtmux/neo.pylines 779–823- Related error-classification issue: #704