remi / teamocil

There's no I in Teamocil. At least not where you think. Teamocil is a simple tool used to automatically create windows and panes in tmux with YAML files.
MIT License
2.35k stars 101 forks source link

Fails to change directory under teamocil 1.4 #104

Closed jarednorman closed 8 years ago

jarednorman commented 8 years ago
~$ chruby 2.2.3
~$ teamocil --here --debug hater
tmux rename-session 'Hater'
tmux send-keys -t 1 'cd "/home/jared/Codes/hater"'
tmux send-keys -t 1 'Enter'
tmux rename-window 'editor'
tmux send-keys -t 1 'clear && g s'
tmux send-keys -t 1 'Enter'
tmux select-layout 'even-vertical'
tmux select-pane -t 1
tmux select-window -t 1
~$ chruby 2.3.0
~$ teamocil --here --debug hater
tmux rename-session 'Hater'
tmux send-keys -t 'editor.1' 'cd "/home/jared/Codes/hater"'
tmux send-keys -t 'editor.1' 'Enter'
tmux rename-window 'editor'
tmux send-keys -t 'editor.1' 'clear && g s'
tmux send-keys -t 'editor.1' 'Enter'
tmux select-layout -t 'editor' 'even-vertical'
tmux select-pane -t editor.1
tmux select-window -t 1

Config:

name: Hater
windows:
  - name: editor
    root: ~/Codes/hater
    focus: true
    layout: even-vertical
    panes:
      - clear && g s

The g s (just alias for git status) fails because the first (and in this case only) window would not be in a git repository. If I add additional windows they work as desired.

remi commented 8 years ago

It looks like you have a different teamocil version depending on your Ruby version. The bug is not actually related to ruby-2.3.0 but to teamocil-1.4.

The bug is also specific to the --here option — it looks like we’re trying to send keys to a named window before renaming it.

Thanks for finding the bug, I’ll look into it! :smile:

jarednorman commented 8 years ago

Aha, I guess I should have checked that. Thanks!

Taluu commented 8 years ago

Is this related to https://github.com/remiprev/teamocil/issues/101#issuecomment-159559239 ?

remi commented 8 years ago

I believe #110 solves this issue and teamocil-1.4.2 should not have problems when running this layout. I’m going to close the issue. Thank you!