Skip to content

Commit 9c67ae6

Browse files
committed
refactor(Session.active_window): Use renamed method
1 parent 9d95438 commit 9c67ae6

File tree

14 files changed

+65
-65
lines changed

14 files changed

+65
-65
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,14 +173,14 @@ Window(@... 2:ha in the bg, Session($1 ...))
173173
Close window:
174174

175175
```python
176-
>>> w = session.attached_window
176+
>>> w = session.active_window
177177
>>> w.kill()
178178
```
179179

180180
Grab remaining tmux window:
181181

182182
```python
183-
>>> window = session.attached_window
183+
>>> window = session.active_window
184184
>>> window.split_window(attach=False)
185185
Pane(%2 Window(@1 1:... Session($1 ...)))
186186
```

conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def add_doctest_fixtures(
4141
doctest_namespace["server"] = request.getfixturevalue("server")
4242
session: "Session" = request.getfixturevalue("session")
4343
doctest_namespace["session"] = session
44-
doctest_namespace["window"] = session.attached_window
44+
doctest_namespace["window"] = session.active_window
4545
doctest_namespace["pane"] = session.attached_pane
4646
doctest_namespace["request"] = request
4747

docs/quickstart.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,11 +302,11 @@ through active {class}`Window`'s.
302302

303303
## Manipulating windows
304304

305-
Now that we know how to create windows, let's use one. Let's use {meth}`Session.attached_window()`
305+
Now that we know how to create windows, let's use one. Let's use {meth}`Session.active_window()`
306306
to grab our current window.
307307

308308
```python
309-
>>> window = session.attached_window
309+
>>> window = session.active_window
310310
```
311311

312312
`window` now has access to all of the objects inside of {class}`Window`.
@@ -320,7 +320,7 @@ Pane(%2 Window(@1 ...:..., Session($1 ...)))
320320

321321
Powered up. Let's have a break down:
322322

323-
1. `window = session.attached_window()` gave us the {class}`Window` of the current attached to window.
323+
1. `window = session.active_window()` gave us the {class}`Window` of the current attached to window.
324324
2. `attach=False` assures the cursor didn't switch to the newly created pane.
325325
3. Returned the created {class}`Pane`.
326326

docs/reference/properties.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ from libtmux.neo import Obj
7575
The same concepts apply for {class}`~libtmux.Window`:
7676

7777
```python
78-
>>> window = session.attached_window
78+
>>> window = session.active_window
7979

8080
>>> window
8181
Window(@1 ...:..., Session($1 ...))

docs/topics/traversal.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Window(@1 ...:..., Session($1 ...))
7171
Grab the currently focused window from session:
7272

7373
```python
74-
>>> session.attached_window
74+
>>> session.active_window
7575
Window(@1 ...:..., Session($1 ...))
7676
```
7777

src/libtmux/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class Server(EnvironmentMixin):
6868
>>> server.sessions[0].windows
6969
[Window(@1 1:..., Session($1 ...)]
7070
71-
>>> server.sessions[0].attached_window
71+
>>> server.sessions[0].active_window
7272
Window(@1 1:..., Session($1 ...))
7373
7474
>>> server.sessions[0].attached_pane

src/libtmux/session.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class Session(Obj, EnvironmentMixin):
5252
>>> session.windows
5353
[Window(@1 ...:..., Session($1 ...)]
5454
55-
>>> session.attached_window
55+
>>> session.active_window
5656
Window(@1 ...:..., Session($1 ...)
5757
5858
>>> session.attached_pane
@@ -347,7 +347,7 @@ def select_window(self, target_window: t.Union[str, int]) -> "Window":
347347
if proc.stderr:
348348
raise exc.LibTmuxException(proc.stderr)
349349

350-
return self.attached_window
350+
return self.active_window
351351

352352
#
353353
# Computed properties
@@ -631,7 +631,7 @@ def kill_window(self, target_window: t.Optional[str] = None) -> None:
631631
@property
632632
def attached_pane(self) -> t.Optional["Pane"]:
633633
"""Return active :class:`Pane` object."""
634-
return self.attached_window.attached_pane
634+
return self.active_window.attached_pane
635635

636636
#
637637
# Dunder

src/libtmux/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def retry_until(
8585
Examples
8686
--------
8787
>>> def fn():
88-
... p = session.attached_window.attached_pane
88+
... p = session.active_window.attached_pane
8989
... return p.pane_current_path is not None
9090
9191
>>> retry_until(fn)

src/libtmux/window.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ class Window(Obj):
6161
>>> window.session
6262
Session(...)
6363
64-
>>> window.window_id == session.attached_window.window_id
64+
>>> window.window_id == session.active_window.window_id
6565
True
6666
67-
>>> window == session.attached_window
67+
>>> window == session.active_window
6868
True
6969
7070
>>> window in session.windows
@@ -577,7 +577,7 @@ def rename_window(self, new_name: str) -> "Window":
577577
578578
Examples
579579
--------
580-
>>> window = session.attached_window
580+
>>> window = session.active_window
581581
582582
>>> window.rename_window('My project')
583583
Window(@1 1:My project, Session($1 ...))
@@ -701,7 +701,7 @@ def select(self) -> "Window":
701701
702702
Examples
703703
--------
704-
>>> window = session.attached_window
704+
>>> window = session.active_window
705705
>>> new_window = session.new_window()
706706
>>> session.refresh()
707707
>>> active_windows = [w for w in session.windows if w.window_active == '1']

tests/test_dataclasses.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def test_pane(
3939

4040
assert __session is not None
4141

42-
__window = __session.attached_window
42+
__window = __session.active_window
4343
__window.split_window()
4444
__pane = __window.split_window()
4545
__window.select_layout("main-vertical")

0 commit comments

Comments
 (0)