-
Notifications
You must be signed in to change notification settings - Fork 109
tmux_cmd doesn't include kwargs #64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
kwargs it only there to pick up That said, I have no objection to adding it if it makes the experience more consistent / pleasant. However, I did want the signature on When I written the To play a bit of devil's advocate in terms of an intuitive, pythonic API: Do you know any other python subprocess-like (command) libraries that accept command line flags as kwargs? |
It does seem big that Think we could smoosh that back into |
Thanks for the context and quick reply Tony! So For your 2nd comment, about changing the args = ['set-environment']
if '-t' not in args:
args.extend(['-t', self.id])
# args = ['set-environment', '-t', 'id'] This should probably not break backwards compatibility too much; it seems better to explicitly include the session id. |
Yes that's on the right track Even better,
It may be worth to put a comment in there that As an aside (not for right now): When I wrote this, I wanted to have a signature for commands like |
The test suite is pretty solid. It tests against tmux itself and has enough coverage there's room to do internal refactors in the future (e.g. normalizing the tmux_cmd argument signature to be more consistent with subprocess') |
#65 is merged. |
Closing since #65 was the outcome. We did not include kwargs in |
In tmux_cmd https://github.com/tony/libtmux/blob/189114cde7e125a482ab984749637fa44d66b284/libtmux/common.py#L132
the func receives args and kwargs but only args are added to form the cmd str
https://github.com/tony/libtmux/blob/189114cde7e125a482ab984749637fa44d66b284/libtmux/common.py#L176
Here is some IPDB output showing this, from tracking down tmux-python/tmuxp#184
So this seems pretty big; any command using tmux_cmd would apply in the current session instead of the target session. Maybe it hasn't been noticed since a common use case isn't use tmuxp inside of an existing TMUX session?
The text was updated successfully, but these errors were encountered: