Migration notesΒΆ
Migration and deprecation notes for libtmux are here, see Changelog as well.
Welcome on board! π
π For safety, always pin the package
π Check the migration notes (You are here)
π£ If you feel something got deprecated and it interrupted you - past, present, or future - voice your opinion on the tracker.
We want to make libtmux fun, reliable, and useful for users.
API changes can be painful.
If we can do something to draw the sting, weβll do it. Weβre taking a balanced approach. Thatβs why these notes are here!
(Please pin the package. π)
Complete Deprecation ReferenceΒΆ
This table provides a quick reference for all deprecated APIs. See version-specific sections below for detailed migration examples and code samples.
Method RenamingsΒΆ
Class |
Deprecated |
Replacement |
Since |
Raises |
|---|---|---|---|---|
Server |
|
|
0.30.0 (2024-02-16) |
0.51.0 |
Session |
|
|
0.30.0 (2024-02-16) |
0.51.0 |
Session |
|
|
0.30.0 (2024-02-16) |
0.51.0 |
Window |
|
|
0.30.0 (2024-02-16) |
0.51.0 |
Window |
|
|
0.30.0 (2024-02-16) |
0.51.0 |
Window |
|
|
0.33.0 (2024-03-17) |
0.51.0 |
Window |
|
|
0.50.0 (2025-11-30) |
(warning) |
Window |
|
|
0.50.0 (2025-11-30) |
(warning) |
Window |
|
|
0.50.0 (2025-11-30) |
(warning) |
Pane |
|
|
0.30.0 (2024-02-16) |
0.51.0 |
Pane |
|
|
0.28.0 (2024-02-14) |
0.51.0 |
Pane |
|
|
0.33.0 (2024-03-17) |
0.51.0 |
Property RenamingsΒΆ
Class |
Deprecated |
Replacement |
Since |
Raises |
|---|---|---|---|---|
Session |
|
|
0.31.0 (2024-02-17) |
0.51.0 |
Session |
|
|
0.31.0 (2024-02-17) |
0.51.0 |
Window |
|
|
0.31.0 (2024-02-17) |
0.51.0 |
Parameter ChangesΒΆ
Method(s) |
Deprecated |
Replacement |
Since |
Raises |
|---|---|---|---|---|
Options/hooks methods |
|
|
0.50.0 (2025-11-30) |
(warning) |
|
|
|
0.28.0 (2024-02-14) |
0.51.0 |
|
|
|
0.33.0 (2024-03-17) |
0.51.0 |
|
|
|
0.28.0 (2024-02-14) |
0.51.0 |
|
|
|
0.16.0 (2022-12-10) |
0.51.0 |
|
|
|
0.16.0 (2022-12-10) |
0.51.0 |
|
|
|
0.16.0 (2022-12-10) |
0.51.0 |
Query/Filter API ChangesΒΆ
Class |
Deprecated |
Replacement |
Since |
Raises |
|---|---|---|---|---|
Server |
|
|
0.17.0 (2022-12-26) |
0.51.0 |
Server |
|
|
0.17.0 (2022-12-26) |
0.51.0 |
Server |
|
|
0.17.0 (2022-12-26) |
0.51.0 |
Server |
|
|
0.17.0 (2022-12-26) |
0.51.0 |
Server |
|
|
0.17.0 (2022-12-26) |
0.51.0 |
Server |
|
|
0.16.0 (2022-12-10) |
0.51.0 |
Session |
|
|
0.17.0 (2022-12-26) |
0.51.0 |
Session |
|
|
0.17.0 (2022-12-26) |
0.51.0 |
Session |
|
|
0.17.0 (2022-12-26) |
0.51.0 |
Session |
|
|
0.16.0 (2022-12-10) |
0.51.0 |
Window |
|
|
0.17.0 (2022-12-26) |
0.51.0 |
Window |
|
|
0.17.0 (2022-12-26) |
0.51.0 |
Window |
|
|
0.17.0 (2022-12-26) |
0.51.0 |
Window |
|
|
0.16.0 (2022-12-10) |
0.51.0 |
All |
|
|
0.17.0 (2022-12-26) |
0.51.0 |
Attribute Access ChangesΒΆ
Pattern |
Deprecated |
Replacement |
Since |
Raises |
|---|---|---|---|---|
Dict key access |
|
|
0.17.0 (2022-12-26) |
0.51.0 |
Dict get |
|
|
0.17.0 (2022-12-26) |
0.51.0 |
Dict get w/ default |
|
|
0.17.0 (2022-12-26) |
0.51.0 |
Removed ItemsΒΆ
Item |
Removed In |
Migration |
|---|---|---|
tmux < 3.2a support |
0.49.0 (2025-11-29) |
Upgrade tmux or use libtmux 0.48.x |
|
0.42.0 (2025-02-02) |
Use |
|
0.42.0 (2025-02-02) |
Use |
|
0.12.0 (2022-07-13) |
Use |
Default Behavior ChangesΒΆ
Method |
Old Default |
New Default |
Since |
|---|---|---|---|
|
|
|
0.28.0 (2024-02-14) |
|
|
|
0.28.0 (2024-02-14) |
Upcoming ReleaseΒΆ
Detailed migration steps for the next version will be posted here.
libtmux 0.50.0: Unified Options and Hooks API (#516)ΒΆ
New unified options APIΒΆ
All tmux objects (Server, Session, Window, Pane) now share a consistent options
interface through OptionsMixin:
# Get all options
session.show_options()
# Get a single option
session.show_option('base-index')
# Set an option
window.set_option('automatic-rename', True)
# Unset an option
window.unset_option('automatic-rename')
New hooks APIΒΆ
All tmux objects now support hook management through
HooksMixin:
# Set a hook
session.set_hook('session-renamed', 'display-message "Renamed!"')
# Get hook value
session.show_hook('session-renamed')
# Get all hooks
session.show_hooks()
# Remove a hook
session.unset_hook('session-renamed')
Deprecated Window methodsΒΆ
The following Window methods are deprecated and will be removed in a future
release:
Deprecated |
Replacement |
|---|---|
|
|
|
|
|
Before (deprecated):
window.set_window_option('automatic-rename', 'on')
window.show_window_option('automatic-rename')
window.show_window_options()
After (0.50.0+):
window.set_option('automatic-rename', True)
window.show_option('automatic-rename')
window.show_options()
Deprecated g parameterΒΆ
The g parameter for global options is deprecated in favor of global_:
Before (deprecated):
session.show_option('status', g=True)
session.set_option('status', 'off', g=True)
After (0.50.0+):
session.show_option('status', global_=True)
session.set_option('status', 'off', global_=True)
Using the old g parameter will emit a DeprecationWarning.
libtmux 0.46.0 (2025-02-25)ΒΆ
Imports removed from libtmux.test (#580)ΒΆ
Root-level of imports from libtmux.test are no longer possible.
# Before 0.46.0
from libtmux.test import namer
# From 0.46.0 onward
from libtmux.test.named import namer
Same thing with constants:
# Before 0.46.0
from libtmux.test import (
RETRY_INTERVAL_SECONDS,
RETRY_TIMEOUT_SECONDS,
TEST_SESSION_PREFIX
)
# From 0.46.0 onward
from libtmux.test.constants import (
RETRY_INTERVAL_SECONDS,
RETRY_TIMEOUT_SECONDS,
TEST_SESSION_PREFIX
)
libtmux 0.45.0 (2025-02-23)ΒΆ
Test helpers: Module movesΒΆ
Test helper functionality has been split into focused modules (#578):
libtmux.testmodule split into:libtmux.test.constants: Test-related constants (TEST_SESSION_PREFIX, etc.)libtmux.test.environment: Environment variable mockinglibtmux.test.random: Random string generation utilitieslibtmux.test.temporary: Temporary session/window management
Breaking: Import paths have changed. Update imports:
# Old (0.44.x and earlier)
from libtmux.test import (
TEST_SESSION_PREFIX,
get_test_session_name,
get_test_window_name,
namer,
temp_session,
temp_window,
EnvironmentVarGuard,
)
# New (0.45.0+)
from libtmux.test.constants import TEST_SESSION_PREFIX
from libtmux.test.environment import EnvironmentVarGuard
from libtmux.test.random import get_test_session_name, get_test_window_name, namer
from libtmux.test.temporary import temp_session, temp_window
0.35.0: Commands require explicit targets (2024-03-17)ΒΆ
Commands require explicit targets (#535)ΒΆ
Server.cmd(),Session.cmd(),Window.cmd(),Pane.cmd()require passingtargetinstead of['-t', target],['-tTargetName'], etc. This change is to avoid issues mistakenly interpreting-tin other shell values as targets.Before:
session.cmd('send-keys', 'echo hello', '-t', '0')
With 0.35.0 and after:
session.cmd('send-keys', 'echo hello', target='0')
0.33.0: Deprecations for splitting (2024-03-03)ΒΆ
Deprecations (#532)ΒΆ
Window.split_window()toWindow.split()Pane.split_window()toPane.split()
0.31.0: Renaming and command cleanup (2024-02-17)ΒΆ
Cleanups (#527)ΒΆ
Commands: Param change
Server.cmd(),Session.cmd(),Window.cmd(),Pane.cmd()Use
cmd: stras first positionalRemoved unused keyword arguments
**kwargs
Renamings (#527)ΒΆ
Session.attached_windowrenamed toSession.active_window()Session.attached_windowdeprecated
Session.attached_panerenamed toSession.active_pane()Session.attached_panedeprecated
Window.attached_panerenamed toWindow.active_pane()Window.attached_panedeprecated
0.28.0: Resizing and detached by default (2024-02-15)ΒΆ
Detach by defaultΒΆ
Session.new_window()+Window.split_window()no longer attaches by default (#523)0.28.0 and greater: Defaults to
attach=False.0.27.1 and below: Defaults to
attach=True.
For the old behavior in 0.28.0 and beyond, pass
attach=Trueexplicitly.
Resizing panesΒΆ
Pane.resize_pane()renamed toPane.resize()(via #523)This convention will be more consistent with
Window.resize().Pane.resize_pane()βs params changed (#523)No longer accepts
-U,-D,-L,-Rdirectly, instead acceptsResizeAdjustmentDirection(see below).0.27.1 and below:
pane.resize_pane("-D", 20),pane.resize_pane("-R", 20)0.28.0 and beyond:
from libtmux.constants import ResizeAdjustmentDirection pane.resize_pane(adjustment_direction=ResizeAdjustmentDirection.Down, adjustment=25) pane.resize_pane( adjustment_direction=ResizeAdjustmentDirection.Right, adjustment=25 )
0.17.0: Simplified attributes (2022-12-26)ΒΆ
Finding objects / relationsΒΆ
0.16 and below:
session._windows(),session.list_windows(), etc.0.17 and after:
session.windows0.16 and below:
session.find_where({'window_name': my_window})0.17 and after:
session.windows.get(window_name=my_window, default=None)If not found and not
default, raisesObjectDoesNotExistIf multiple objects found, raises
MultipleObjectsReturned
0.16 and below:
session.where({'window_name': my_window})0.17 and after:
session.windows.filter(window_name=my_window)
Accessing attributesΒΆ
0.16 and below:
window['id']0.17 and after:
window.id0.16 and below:
window.get('id')0.17 and after:
window.id0.16 and below:
window.get('id', None)0.17 and after:
getattr(window, 'id', None)