36
36
37
37
@dataclasses .dataclass ()
38
38
class Session (Obj , EnvironmentMixin ):
39
- """
40
- A :term:`tmux(1)` :term:`Session` [session_manual]_.
39
+ """:term:`tmux(1)` :term:`Session` [session_manual]_.
41
40
42
41
Holds :class:`Window` objects.
43
42
@@ -97,7 +96,7 @@ def from_session_id(cls, server: "Server", session_id: str) -> "Session":
97
96
#
98
97
@property
99
98
def windows (self ) -> QueryList ["Window" ]: # type:ignore
100
- """Windows belonging session.
99
+ """Windows contained by session.
101
100
102
101
Can be accessed via
103
102
:meth:`.windows.get() <libtmux._internal.query_list.QueryList.get()>` and
@@ -117,7 +116,7 @@ def windows(self) -> QueryList["Window"]: # type:ignore
117
116
118
117
@property
119
118
def panes (self ) -> QueryList ["Pane" ]: # type:ignore
120
- """Panes belonging session.
119
+ """Panes contained by session's windows .
121
120
122
121
Can be accessed via
123
122
:meth:`.panes.get() <libtmux._internal.query_list.QueryList.get()>` and
@@ -139,8 +138,7 @@ def panes(self) -> QueryList["Pane"]: # type:ignore
139
138
# Command
140
139
#
141
140
def cmd (self , * args : t .Any , ** kwargs : t .Any ) -> tmux_cmd :
142
- """
143
- Return :meth:`server.cmd`.
141
+ """Execute tmux subcommand against target session. See :meth:`server.cmd`.
144
142
145
143
Returns
146
144
-------
@@ -173,8 +171,7 @@ def cmd(self, *args: t.Any, **kwargs: t.Any) -> tmux_cmd:
173
171
def set_option (
174
172
self , option : str , value : t .Union [str , int ], _global : bool = False
175
173
) -> "Session" :
176
- """
177
- Set option ``$ tmux set-option <option> <value>``.
174
+ """Set option ``$ tmux set-option <option> <value>``.
178
175
179
176
Parameters
180
177
----------
@@ -225,8 +222,7 @@ def set_option(
225
222
def show_options (
226
223
self , _global : t .Optional [bool ] = False
227
224
) -> t .Dict [str , t .Union [str , int ]]:
228
- """
229
- Return a dict of options for the window.
225
+ """Return dict of options for the session.
230
226
231
227
Parameters
232
228
----------
@@ -316,8 +312,7 @@ def show_option(
316
312
return value
317
313
318
314
def select_window (self , target_window : t .Union [str , int ]) -> "Window" :
319
- """
320
- Return :class:`Window` selected via ``$ tmux select-window``.
315
+ """Select window, return selected window.
321
316
322
317
Parameters
323
318
----------
@@ -377,15 +372,14 @@ def attach_session(self) -> "Session":
377
372
return self
378
373
379
374
def kill_session (self ) -> None :
380
- """``$ tmux kill- session`` ."""
375
+ """Destroy session."""
381
376
proc = self .cmd ("kill-session" , "-t%s" % self .session_id )
382
377
383
378
if proc .stderr :
384
379
raise exc .LibTmuxException (proc .stderr )
385
380
386
381
def switch_client (self ) -> "Session" :
387
- """
388
- Switch client to this session.
382
+ """Switch client to session.
389
383
390
384
Raises
391
385
------
@@ -399,8 +393,7 @@ def switch_client(self) -> "Session":
399
393
return self
400
394
401
395
def rename_session (self , new_name : str ) -> "Session" :
402
- """
403
- Rename session and return new :class:`Session` object.
396
+ """Rename session and return new :class:`Session` object.
404
397
405
398
Parameters
406
399
----------
@@ -440,8 +433,7 @@ def new_window(
440
433
window_shell : t .Optional [str ] = None ,
441
434
environment : t .Optional [t .Dict [str , str ]] = None ,
442
435
) -> "Window" :
443
- """
444
- Return :class:`Window` from ``$ tmux new-window``.
436
+ """Create new window, returns new :class:`Window`.
445
437
446
438
By default, this will make the window active. For the new window
447
439
to be created and not set to current, pass in ``attach=False``.
0 commit comments