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.36k stars 101 forks source link

Add focus key to windows #64

Closed mreinhardt closed 10 years ago

mreinhardt commented 10 years ago

There's a focus key for panes to select which pane to focus on intially. I'd like to have this key for windows as well since I always start working in my first window instead of the last.

rasca commented 10 years ago

This feature already exists. It should be documented though.

mreinhardt commented 10 years ago

Any idea why this doesn't work then and still focuses on the last window?

windows:
  - name: dev server
    clear: true
    focus: true
    panes:
      - cmd: ssh-dev-server.sh
  - name: w2
    ...options etc...
  - name: w3
    ...options etc...
  - name: w4
    ...options etc...
remi commented 10 years ago

@mreinhardt Can you test it with teamocil 1.0?

mreinhardt commented 10 years ago

After upgrading to 1.0 I'm getting an error when I try to run teamocil --here ls (ls is my yaml file):

/Users/mikereinhardt/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': /Users/mikereinhardt/.rvm/gems/ruby-2.0.0-p451/gems/teamocil-1.0/lib/teamocil.rb:50: syntax error, unexpected ')' (SyntaxError)
/Users/mikereinhardt/.rvm/gems/ruby-2.0.0-p451/gems/teamocil-1.0/lib/teamocil.rb:54: syntax error, unexpected keyword_end, expecting end-of-input
        from /Users/mikereinhardt/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /Users/mikereinhardt/.rvm/gems/ruby-2.0.0-p451/gems/teamocil-1.0/bin/teamocil:4:in `<top (required)>'
        from /Users/mikereinhardt/.rvm/gems/ruby-2.0.0-p451/bin/teamocil:23:in `load'
        from /Users/mikereinhardt/.rvm/gems/ruby-2.0.0-p451/bin/teamocil:23:in `<main>'
        from /Users/mikereinhardt/.rvm/gems/ruby-2.0.0-p451/bin/ruby_executable_hooks:15:in `eval'
        from /Users/mikereinhardt/.rvm/gems/ruby-2.0.0-p451/bin/ruby_executable_hooks:15:in `<main>'
remi commented 10 years ago

Oh, that’s because it was Ruby 2.1+ only…

I just pushed teamocil-1.0.1 which should now work with Ruby 2.0+. Sorry about that!

mreinhardt commented 10 years ago

The focus itself worked, but I'm having other more serious problems now (not opening all windows, commands from other windows being run in the first window) that I'll open a new issue for. Thanks.

remi commented 10 years ago

Alright, thanks!