Skip to content

tmux_cmd doesn't include kwargs #64

Description

@askedrelic

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

# Reach tmux_cmd() with args and kwargs
> /usr/local/var/pyenv/versions/2.7.11/lib/python2.7/site-packages/libtmux/server.py(99)cmd()
     97                 raise ValueError('Server.colors must equal 88 or 256')
     98
---> 99         return tmux_cmd(*args, **kwargs)
    100
    101     def _list_sessions(self):

ipdb> args
self = <libtmux.server.Server object at 0x10fd11350>
args = [u'-2', 'set-environment', 'FOO', 'bar']
kwargs = {u'-t': u'$8'}

# Reach cmd and kwargs not included
ipdb>
> /usr/local/var/pyenv/versions/2.7.11/lib/python2.7/site-packages/libtmux/common.py(179)__init__()
    177         cmd = [str(c) for c in cmd]
    178
--> 179         self.cmd = cmd
    180
    181         try:

ipdb> cmd
['/usr/local/bin/tmux', '-2', 'set-environment', 'FOO', 'bar']

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions