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

Command is executed in the wrong window! #77

Merged
merged 1 commit into from Apr 1, 2014

Conversation

Projects
None yet
2 participants
@ThiefMaster
Contributor

ThiefMaster commented Apr 1, 2014

I have this config (the echoes are just to avoid actually starting stuff while testing things).

After loading it, almost everything is fine except the ssh indico-lb-test command. It's entered (not executed, i.e. no ENTER after the command) in the first pane of window 4 (actually in whatever pane is focused in that window, when removing the focus entry it's started in another pane of that window).

session_name: main
windows:
  #1 - root
  -
    window_name: root
    panes:
      -
        shell_command:
          - sudo su -
          - tmux a || tmux
  #2 - indico
  - 
    window_name: indico
    layout: "98b6,317x91,0,0[317x8,0,0,1,317x82,0,9,2]"
    start_directory: ~/dev/indico/src
    focus: true
    panes:
      - echo tail -f ../data/log/indico.log
      -
        focus: true
        shell_command:
  #3 - dev-a
  - 
    window_name: dev-a
    start_directory: ~/dev/indico/src
    panes:
      - echo ssh indicodev-adrian
  #4 - puppet
  -
    window_name: puppet
    layout: tiled
    start_directory:  ~/dev/it-puppet-hostgroup-indico
    panes:
      -
        focus: true
        shell_command:
      -
        start_directory: ~/dev/it-puppet-module-indico_linux_goodies
        shell_command:
      -
        start_directory: ~/dev/it-puppet-hostgroup-jabber
        shell_command:
      -
        start_directory: ~/dev/it-puppet-hostgroup-indic8r
        shell_command:
  #5 - lb-test
  - 
    window_name: lb-test
    panes:
      - echo ssh indico-lb-test
  #6 - cernres
  - 
    window_name: cernres
    start_directory: ~/dev/indico-cern-resources
    panes:
      -
  #7 - aiadm
  - 
    window_name: aiadm
    panes:
      - echo ssh aiadm
@tony

This comment has been minimized.

Member

tony commented Mar 31, 2014

@ThiefMaster

This needs to be isolated a bit more. What if it was just section 4 and 5?

Does changing shell_command: to pane help?

@ThiefMaster

This comment has been minimized.

Contributor

ThiefMaster commented Apr 1, 2014

Ok, I found the issue. It's caused by a command containing -t. Here's a minimal case to reproduce it:

session_name: bug
windows:
  - window_name: a
    panes:
      -
  - window_name: b
    panes:
      - foo-t

With foo-bar it works fine, but as soon as as there's -t in it (no matter where) it starts failing.

@tony

This comment has been minimized.

Member

tony commented Apr 1, 2014

Does wrapping it in single quotes give the same result?

On Tuesday, April 1, 2014, ThiefMaster notifications@github.com wrote:

Ok, I found the issue. It's caused by a command containing -t. Here's a
minimal case to reproduce it:

session_name: bug
windows:

  • window_name: a
    panes:

  • window_name: b
    panes:
    • foo-t

Reply to this email directly or view it on GitHubhttps://github.com//issues/77#issuecomment-39227437
.

@ThiefMaster

This comment has been minimized.

Contributor

ThiefMaster commented Apr 1, 2014

Yey. Even - '"foo-t"' and - "'foo-t'" cause this issue.

Update: Found the problem. PR coming in a few minutes.

@@ -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)]):

This comment has been minimized.

@ThiefMaster

ThiefMaster Apr 1, 2014

Contributor

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

This comment has been minimized.

@tony

tony Apr 1, 2014

Member

@ThiefMaster I don't believe so.

@tony

This comment has been minimized.

Member

tony commented Apr 1, 2014

@ThiefMaster: Let me know when you are done with the changes / PR's for the night. Do you still want to take a stab at #73 tonight or come back to it later?

@ThiefMaster

This comment has been minimized.

Contributor

ThiefMaster commented Apr 1, 2014

Done for today!

tony added a commit that referenced this pull request Apr 1, 2014

Merge pull request #77 from ThiefMaster/fix-dash-t-command
Command is executed in the wrong window!

@tony tony merged commit 803eb85 into tmux-python:master Apr 1, 2014

1 check passed

default The Travis CI build passed
Details

tony added a commit that referenced this pull request Apr 1, 2014

@ThiefMaster ThiefMaster deleted the ThiefMaster:fix-dash-t-command branch Apr 2, 2014

@tony

This comment has been minimized.

Member

tony commented Apr 2, 2014

@ThiefMaster: While you were resting, travis finished the tests and I went ahead and published these 3 patches as v0.1.9. Way to go!

http://tmuxp.readthedocs.org/en/latest/history.html

@ThiefMaster

This comment has been minimized.

Contributor

ThiefMaster commented Apr 2, 2014

I think something went wrong with the merge (did you by any change perform an accidentally forced push after merging the PRs)?

> git lg -3 upstream/master
* 0b880b7 - (HEAD, tag: v0.1.9, upstream/master, origin/master, origin/HEAD, master) Version 0.1.9, changes by @ThiefMaster #73, #76, #77. (11 hours ago) <Tony Narlock>
* e19147e - tests: cli.py remove an unused config fixture. (35 hours ago) <Tony Narlock>
* 913aaaf - Add note about py34 in tox.ini, remove print() in helpers.py, clean up doc comment. (35 hours ago) <Tony Narlock>

@ThiefMaster ThiefMaster restored the ThiefMaster:fix-dash-t-command branch Apr 2, 2014

@tony

This comment has been minimized.

Member

tony commented Apr 2, 2014

@ThiefMaster : I see you were able to restore the the branches, keep them there and I will re-merge them when I get back tonight? Sorry about that, it happened during the downtime yesterday https://status.github.com/messages.

@tony

This comment has been minimized.

Member

tony commented Apr 3, 2014

@ThiefMaster : v0.1.10 on pypi. Better now?

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