Skip to content

v0.51.0 (Breaking API deprecations)

Latest

Choose a tag to compare

@tony tony released this 06 Dec 21:16

Breaking Changes

Deprecate legacy APIs

Legacy API methods (deprecated in v0.16–v0.33) now raise DeprecatedError (hard error) instead of emitting DeprecationWarning.

See the migration guide for full context and examples.

  • Deprecate legacy APIs (raise DeprecatedError) by @tony in #611

Method Renamings

Deprecated Replacement Class Deprecated Since
kill_server() kill() Server 0.30.0
attach_session() attach() Session 0.30.0
kill_session() kill() Session 0.30.0
select_window() select() Window 0.30.0
kill_window() kill() Window 0.30.0
split_window() split() Window 0.33.0
select_pane() select() Pane 0.30.0
resize_pane() resize() Pane 0.28.0
split_window() split() Pane 0.33.0

Property Renamings

Deprecated Replacement Class Deprecated Since
attached_window active_window Session 0.31.0
attached_pane active_pane Session 0.31.0
attached_pane active_pane Window 0.31.0

Query/Filter API Changes

Deprecated Replacement Class Deprecated Since
list_sessions() / _list_sessions() sessions property Server 0.17.0
list_windows() / _list_windows() windows property Session 0.17.0
list_panes() / _list_panes() panes property Window 0.17.0
where({...}) .filter(**kwargs) on sessions/windows/panes All 0.17.0
find_where({...}) .get(default=None, **kwargs) on sessions/windows/panes All 0.17.0
get_by_id(id) .get(session_id/window_id/pane_id=..., default=None) All 0.16.0
children property sessions/windows/panes All 0.17.0

Attribute Access Changes

Deprecated Replacement Deprecated Since
obj['key'] obj.key 0.17.0
obj.get('key') obj.key 0.17.0
obj.get('key', None) getattr(obj, 'key', None) 0.17.0

Still Soft Deprecations (DeprecationWarning)

The following deprecations from v0.50.0 continue to emit DeprecationWarning only:

Deprecated Replacement Class
set_window_option() set_option() Window
show_window_option() show_option() Window
show_window_options() show_options() Window
g parameter global_ parameter Options & hooks methods

Migration Example

Before (deprecated, now raises DeprecatedError):

# Old method names
server.kill_server()
session.attach_session()
window.split_window()
pane.resize_pane()

# Old query API
server.list_sessions()
session.find_where({'window_name': 'main'})

# Old dict-style access
window['window_name']

After:

# New method names
server.kill()
session.attach()
window.split()
pane.resize()

# New query API
server.sessions
session.windows.get(window_name='main', default=None)

# New attribute access
window.window_name

Links

Full Changelog: v0.50.1...v0.51.0