Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ $ pip install --user --upgrade --pre libtmux

<!-- To maintainers and contributors: Please add notes for the forthcoming version above -->

### Breaking changes

- Eliminate redundant targets / `window_index`'s across codebase (#536).

## libtmux 0.34.0 (2024-03-17)

### Breaking changes
Expand Down
6 changes: 3 additions & 3 deletions src/libtmux/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ def switch_client(self) -> "Session":
------
:exc:`exc.LibTmuxException`
"""
proc = self.cmd("switch-client", target=self.session_id)
proc = self.cmd("switch-client")

if proc.stderr:
raise exc.LibTmuxException(proc.stderr)
Expand Down Expand Up @@ -803,7 +803,7 @@ def attach_session(self) -> "Session":
category=DeprecationWarning,
stacklevel=2,
)
proc = self.cmd("attach-session", target=self.session_id)
proc = self.cmd("attach-session")

if proc.stderr:
raise exc.LibTmuxException(proc.stderr)
Expand All @@ -824,7 +824,7 @@ def kill_session(self) -> None:
category=DeprecationWarning,
stacklevel=2,
)
proc = self.cmd("kill-session", target=self.session_id)
proc = self.cmd("kill-session")

if proc.stderr:
raise exc.LibTmuxException(proc.stderr)
Expand Down
10 changes: 3 additions & 7 deletions src/libtmux/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def select_pane(self, target_pane: t.Union[str, int]) -> t.Optional["Pane"]:
:class:`Pane`
"""
if target_pane in ["-l", "-U", "-D", "-L", "-R"]:
proc = self.cmd("select-pane", target_pane, target=self.window_id)
proc = self.cmd("select-pane", target_pane)
else:
proc = self.cmd("select-pane", target=target_pane)

Expand Down Expand Up @@ -378,7 +378,7 @@ def select_layout(self, layout: t.Optional[str] = None) -> "Window":
if layout: # tmux allows select-layout without args
cmd.append(layout)

proc = self.cmd(*cmd, target=f"{self.session_id}:{self.window_index}")
proc = self.cmd(*cmd)

if proc.stderr:
raise exc.LibTmuxException(proc.stderr)
Expand Down Expand Up @@ -412,7 +412,6 @@ def set_window_option(self, option: str, value: t.Union[int, str]) -> "Window":
"set-window-option",
option,
value,
target=f"{self.session_id}:{self.window_index}",
)

if isinstance(cmd.stderr, list) and len(cmd.stderr):
Expand Down Expand Up @@ -920,10 +919,7 @@ def kill_window(self) -> None:
category=DeprecationWarning,
stacklevel=2,
)
proc = self.cmd(
"kill-window",
target=f"{self.session_id}:{self.window_index}",
)
proc = self.cmd("kill-window")

if proc.stderr:
raise exc.LibTmuxException(proc.stderr)
Expand Down