File tree Expand file tree Collapse file tree 1 file changed +23
-9
lines changed Expand file tree Collapse file tree 1 file changed +23
-9
lines changed Original file line number Diff line number Diff line change @@ -130,30 +130,44 @@ Direct lookup:
130
130
Session($ 1 ... )
131
131
```
132
132
133
- Find session by dict lookup :
133
+ Filter sesions :
134
134
135
135
``` python
136
136
>> > server.sessions[0 ].rename_session(' foo' )
137
137
Session($ 1 foo)
138
- >> > server.sessions.filter(session_name = " foo" )[0 ]
138
+ >> > server.sessions.filter(session_name = " foo" )
139
+ [Session($ 1 foo)]
140
+ >> > server.sessions.get(session_name = " foo" )
139
141
Session($ 1 foo)
140
142
```
141
143
142
144
Control your session:
143
145
144
146
``` python
145
- >> > session.rename_session( ' foo ' )
146
- Session($ 1 foo )
147
- >> > session.new_window( attach = False , window_name = " ha in the bg " )
148
- Window( @ 2 2 :ha in the bg, Session( $ 1 foo) )
149
- >> > session.kill_window( " ha in " )
147
+ >> > session
148
+ Session($ 1 ... )
149
+
150
+ >> > session.rename_session( ' my-session ' )
151
+ Session( $ 1 my - session )
150
152
```
151
153
152
154
Create new window in the background (don't switch to it):
153
155
154
156
``` python
155
- >> > session.new_window(attach = False , window_name = " ha in the bg" )
156
- Window(@ 2 2 :ha in the bg, Session($ 1 ... ))
157
+ >> > bg_window = session.new_window(attach = False , window_name = " ha in the bg" )
158
+ >> > bg_window
159
+ Window(@ ... 2 :ha in the bg, Session($ 1 ... ))
160
+
161
+ # Session can search the window
162
+ >> > session.windows.filter(window_name__startswith = " ha" )
163
+ [Window(@ ... 2 :ha in the bg, Session($ 1 ... ))]
164
+
165
+ # Directly
166
+ >> > session.windows.get(window_name__startswith = " ha" )
167
+ Window(@ ... 2 :ha in the bg, Session($ 1 ... ))
168
+
169
+ # Clean up
170
+ >> > bg_window.kill()
157
171
```
158
172
159
173
Close window:
You can’t perform that action at this time.
0 commit comments