@@ -125,33 +125,33 @@ Windows and Panes.
125125If you have multiple tmux sessions open, you can see that all of the
126126methods in {class}` Server ` are available.
127127
128- We can list sessions with {meth}` Server.list_sessions ` :
128+ We can list sessions with {meth}` Server.sessions ` :
129129
130130``` python
131- >> > server.list_sessions()
131+ >> > server.sessions
132132[Session($ 1 ... ), Session($ 0 ... )]
133133```
134134
135135This returns a list of {class}` Session ` objects you can grab. We can
136136find our current session with:
137137
138138``` python
139- >> > server.list_sessions() [0 ]
139+ >> > server.sessions [0 ]
140140Session($ 1 ... )
141141```
142142
143143However, this isn't guaranteed, libtmux works against current tmux information, the
144144session's name could be changed, or another tmux session may be created,
145- so {meth}` Server.get_by_id ` and {meth}` Server.find_where ` exists as a lookup.
145+ so {meth}` Server.sessions ` and {meth}` Server.windows ` exists as a lookup.
146146
147147## Get session by ID
148148
149149tmux sessions use the ` $[0-9] ` convention as a way to identify sessions.
150150
151- ` $1 ` is whatever the ID ` list_sessions ()` returned above.
151+ ` $1 ` is whatever the ID ` sessions ()` returned above.
152152
153153``` python
154- >> > server.get_by_id( ' $1' )
154+ >> > server.sessions.filter( session_id = ' $1' )[ 0 ]
155155Session($ 1 ... )
156156```
157157
@@ -163,13 +163,16 @@ You may `session = server.get_by_id('$<yourId>')` to use the session object.
163163>> > server.sessions[0 ].rename_session(' foo' )
164164Session($ 1 foo)
165165
166- >> > server.find_where({ " session_name" : " foo" })
166+ >> > server.sessions.filter(session_name = " foo" )[0 ]
167+ Session($ 1 foo)
168+
169+ >> > server.sessions.get(session_name = " foo" )
167170Session($ 1 foo)
168171```
169172
170- With ` find_where ` , pass in a dict and return the first object found . In
173+ With ` filter ` , pass in attributes and return a list of matches . In
171174this case, a {class}` Server ` holds a collection of child {class}` Session ` .
172- {class}` Session ` and {class}` Window ` both utilize ` find_where ` to sift
175+ {class}` Session ` and {class}` Window ` both utilize ` filter ` to sift
173176through Windows and Panes, respectively.
174177
175178So you may now use:
@@ -178,7 +181,7 @@ So you may now use:
178181>> > server.sessions[0 ].rename_session(' foo' )
179182Session($ 1 foo)
180183
181- >> > session = server.find_where({ " session_name" : " foo" } )
184+ >> > session = server.sessions.get( session_name = " foo" )
182185>> > session
183186Session($ 1 foo)
184187```
@@ -213,7 +216,7 @@ Let's delete that window ({meth}`Session.kill_window`).
213216Method 1: Use passthrough to tmux's ` target ` system.
214217
215218``` python
216- >> > session.kill_window(window.id )
219+ >> > session.kill_window(window.window_id )
217220```
218221
219222The window in the bg dissappeared. This was the equivalent of
@@ -260,7 +263,7 @@ And kill:
260263>> > window.kill_window()
261264```
262265
263- Use {meth}` Session.list_windows() ` and {meth}` Session.find_where () ` to list and sort
266+ Use {meth}` Session.windows ` and {meth}` Session.windows.filter () ` to list and sort
264267through active {class}` Window ` 's.
265268
266269## Manipulating windows
@@ -346,6 +349,7 @@ using {meth}`Pane.enter()`:
346349
347350``` python
348351>> > pane.enter()
352+ Pane(% 1 ... )
349353```
350354
351355### Avoid cluttering shell history
0 commit comments