How to specify focus: true for a pane?
richardkmichael opened this issue · comments
In 1.0, how do I focus a pane? (I've migrated from 0.4, and my layout file needs updating.)
This worked in 0.4:
windows:
- name: "rails: s/c"
root: "~/project"
panes:
- cmd: "bundle exec rails s"
- cmd: "bundle exec rails c"
focus: true
I've also tried specifying the pane in the new abbreviated String form, but it results in Teamocil::Error::InvalidYAMLLayout
:
(Aside, here it would be helpful if teamocil would output the offending YAML line.)
windows:
- name: "rails: s/c"
root: "~/project"
panes:
- bundle exec rails s
- bundle exec rails c
focus: true
I've also tried specifying the pane as a Hash, it results in undefined method join
for "bundle exec rails c":
windows:
- name: "rails: s/c"
root: "~/project"
panes:
- bundle exec rails s
- { commands: "bundle exec rails c", focus: true }
commands
should be an array :)
If commands
is an Array, doesn't it run all those commands in one single pane? I want two panes (one for each command), and focus in the second pane.
yes, but it expects the commands
parameter to be an array.You can still use an array with a single command in it ; commands: ['pwd']
I see, thank you!
- name: "rails: s/c"
root: "~/code"
panes:
- { commands: [ 'bundle exec rails s' ] }
- { commands: [ 'bundle exec rails c' ], focus: true }
BTW, your commands: [ 'pwd' ]
example .. I use that too, as a "no-op" to launch a pane with just a shell. Is there a better way to ask teamocil to start a new pane with just the shell waiting for input?
I'm also using that as a no-op command.
I’m closing this issue since the example has been added to the README. Thanks all!