Repository navigation
libtmux 0.67.1 fixes Session.new_window() with select_existing=True, which now finds a window by its literal name on every tmux and returns it instead of raising IndexError, and the format guide now says what a format can run.
Highlights
select_existing=Truefinds a literal name on every tmux. libtmux now looks the window name up itself instead of relying on tmux'snew-window -S, which matches a name differently per release: tmux 3.3a compared the escaped name, so a name containing#,%,,or}created a duplicate window, and tmux 3.7 and later expanded it a second time, so a name like#{session_name}could select another window. AFormatname is expanded once against the session, then looked up. The existing window is returned and selected only withattach=True, and two windows with the name raiseLibTmuxException. Withwindow_indexortarget_window, tmux's-Sstill decides (#917).- The format guide says what a format can run. A
Formathands its text to tmux's format language, which runs#(...)as a shell command and expands an option's value again throughE:andT:. The guide now says so, and that a plainstrfrom a user passed to an argument tmux always expands, such asdisplay_message, runs any#(...)it contains;Format.escape()shows such text exactly (#915).
Two limits of the select_existing lookup: the lookup and the creation are separate tmux commands, so two callers can both create the window, and a name containing a backslash is not found once tmux stores it escaped (after rename_window, and for any new window from tmux 3.7).
See Literal text and tmux formats and the changelog for details.
What's Changed
- docs(formats): Say what a format can run by @tony in #915
- Session(fix[new_window]): Look up reuse by name by @tony in #917
Full Changelog: v0.67.0...v0.67.1