10BC0 Command is executed in the wrong window! by ThiefMaster · Pull Request #77 · tmux-python/tmuxp · GitHub
[go: up one dir, main page]

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
2 changes: 1 addition & 1 deletion tmuxp/pane.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def tmux(self, cmd, *args, **kwargs):
:rtype: :class:`Server.tmux`

"""
if not len([arg for arg in args if '-t' in arg]):
if not any(arg.startswith('-t') for arg in args):
args = ('-t', self.get('pane_id')) + args

return self.server.tmux(cmd, *args, **kwargs)
Expand Down
2 changes: 1 addition & 1 deletion 8000 tmuxp/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def tmux(self, cmd, *args, **kwargs):
:rtype: :class:`Server.tmux`

"""
if not len([arg for arg in args if '-t' in str(arg)]):
if not any(arg.startswith('-t') for arg in args):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All tests succeed, is there any case where arg wouldn't be a string?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ThiefMaster I don't believe so.

args = ('-t', self.get('window_id')) + args

return self.server.tmux(cmd, *args, **kwargs)
Expand Down
0