Client.attached_session
Return the Session this client is currently attached to.
Source and package
- Qualified name
-
libtmux.Client .attached _session - Module
- libtmux
- Declared in
- Client
- Package
- libtmux
- Source
- src/libtmux/client.py
-
Description#
Re-reads the client from
list-clientsbefore resolving, so the returnedSessionreflects the client's live attachment rather than the snapshot captured when thisClientwas read. ReturnsNonewhen tmux no longer reports thisclient_namethroughlist-clients, when the client is not attached to any session, or when the snapshotsession_idno longer names a live session.Examples#
>>> with control_mode() as ctl:... client = server.clients.get(client_name=ctl.client_name)... attached = client.attached_session>>> attached is not NoneTrue