Skip to content

Commit 27e932a

Browse files
committed
chore: Migrate to libtmux v0.30+ named methods
1 parent 61fd9ed commit 27e932a

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/tmuxp/cli/load.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ def load_workspace(
474474

475475
if choice == "k":
476476
if builder.session is not None:
477-
builder.session.kill_session()
477+
builder.session.kill()
478478
tmuxp_echo("Session killed.")
479479
elif choice == "a":
480480
_reattach(builder)

src/tmuxp/workspace/builder.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ def build(self, session: t.Optional[Session] = None, append: bool = False) -> No
270270
cwd = self.session_config["start_directory"]
271271
run_before_script(self.session_config["before_script"], cwd=cwd)
272272
except Exception:
273-
self.session.kill_session()
273+
self.session.kill()
274274
raise
275275

276276
if "options" in self.session_config:
@@ -311,10 +311,10 @@ def build(self, session: t.Optional[Session] = None, append: bool = False) -> No
311311
plugin.after_window_finished(window)
312312

313313
if focus_pane:
314-
focus_pane.select_pane()
314+
focus_pane.select()
315315

316316
if focus:
317-
focus.select_window()
317+
focus.select()
318318

319319
def iter_create_windows(
320320
self,
@@ -403,7 +403,7 @@ def iter_create_windows(
403403
assert isinstance(window, Window)
404404

405405
if is_first_window_pass: # if first window, use window 1
406-
session.attached_window.kill_window()
406+
session.attached_window.kill()
407407

408408
if "options" in window_config and isinstance(
409409
window_config["options"],
@@ -413,7 +413,7 @@ def iter_create_windows(
413413
window.set_window_option(key, val)
414414

415415
if window_config.get("focus"):
416-
window.select_window()
416+
window.select()
417417

418418
yield window, window_config
419419

tests/workspace/test_builder.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,10 @@ def assertIsMissing(cmd: str, hist: str) -> bool:
187187
(isMissingWindow, "isMissing", assertIsMissing),
188188
]:
189189
assert w.name == window_name
190-
w.select_window()
190+
w.select()
191191
p = w.attached_pane
192192
assert p is not None
193-
p.select_pane()
193+
p.select()
194194

195195
# Print the last-in-history command in the pane
196196
p.cmd("send-keys", " fc -ln -1")
@@ -1539,8 +1539,8 @@ def test_issue_800_default_size_many_windows(
15391539
assert builder is not None
15401540
assert builder.session is not None
15411541
assert isinstance(builder.session, Session)
1542-
assert callable(builder.session.kill_session)
1543-
builder.session.kill_session()
1542+
assert callable(builder.session.kill)
1543+
builder.session.kill()
15441544

15451545
with pytest.raises(libtmux.exc.LibTmuxException, match="no space for new pane"):
15461546
builder.build()

0 commit comments

Comments
 (0)