Comments (12)
👍 for this issue.
from teamocil.
I'm having this problem too. There's no problem focusing a pane as long as it's in the last window, but there's no way to switch to a specific window after initialization.
from teamocil.
Oh, never mind. It looks like #53 added the focus option for windows. @toobulkeh Try updating the gem, that worked for me.
from teamocil.
@thewatts Can you test it with teamocil 1.0 please? Thanks!
from teamocil.
Focus isn't working correctly in 1.0.3. In the below example I would expect the last select-window statement to choose window 2.
windows:
- name: window-1
focus: true
root: /
panes:
- ls
- name: window-2
root: /
panes:
- ls
Deep-Thought:~ $ tmux list-windows
0: bash* (1 panes) [242x80] [layout b49d,242x80,0,0,0] @0 (active)
1: bash- (1 panes) [234x62] [layout b95e,234x62,0,0,1] @1
Deep-Thought:~ $ teamocil --debug test
tmux rename-session 'teamocil-session-506052'
tmux new-window -n 'window-1' -c '/'
tmux send-keys -t 0 'ls'
tmux send-keys -t 0 'Enter'
tmux select-layout ''
tmux select-pane -t 0
tmux new-window -n 'window-2' -c '/'
tmux send-keys -t 0 'ls'
tmux send-keys -t 0 'Enter'
tmux select-layout ''
tmux select-pane -t 0
tmux select-window -t 0
from teamocil.
@remiprev --- I posted a response days ago... but it must not have gone through.
I'll repost here in the next day or so.
Sorry about that!
from teamocil.
The first window (index 0
) in the YAML file has the focus: true
option. Therefore, tmux select-window -t 0
is sent by teamocil
— I don’t see what’s wrong with that.
In the below example I would expect the last select-window statement to choose window 2.
Why?
from teamocil.
Because there are already existing windows 0 and 1, so the first window teamocil creates is at index 2. Since teamocil is run within tmux, there is always at least 1 existing window.
from teamocil.
Oh, yes, you’re right. I never use teamocil with multiple window layout so I never tested this.
I just pushed a fix on master
— could you test it?
This is also where I should be starting to rewrite the whole test suite 😄
from teamocil.
It didn't work for me, I got the following error.
Deep-Thought:~/Projects/3rdparty/teamocil (master) $ tmux ls
teamocil-session-147586: 1 windows (created Thu Aug 21 10:23:32 2014) [204x51] (attached)
Deep-Thought:~/Projects/3rdparty/teamocil (master) $ teamocil --show test
windows:
- name: window-1
root: "~"
focus: true
panes:
- ls
- name: window-2
root: "~"
panes:
- ls
Deep-Thought:~/Projects/3rdparty/teamocil (master) $ teamocil test
/Users/john/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/teamocil-1.0.5/lib/teamocil/tmux/window.rb:48:in `internal_index': undefined method `window_base_index' for Teamocil::Tmux::Window:Class (NoMethodError)
from /Users/john/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/teamocil-1.0.5/lib/teamocil/tmux/session.rb:25:in `block in as_tmux'
from /Users/john/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/teamocil-1.0.5/lib/teamocil/tmux/session.rb:19:in `tap'
from /Users/john/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/teamocil-1.0.5/lib/teamocil/tmux/session.rb:19:in `as_tmux'
from /Users/john/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/teamocil-1.0.5/lib/teamocil/layout.rb:37:in `shell_commands'
from /Users/john/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/teamocil-1.0.5/lib/teamocil/layout.rb:7:in `execute!'
from /Users/john/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/teamocil-1.0.5/lib/teamocil/cli.rb:21:in `run!'
from /Users/john/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/teamocil-1.0.5/bin/teamocil:7:in `<top (required)>'
from /Users/john/.rbenv/versions/2.0.0-p451/bin/teamocil:23:in `load'
from /Users/john/.rbenv/versions/2.0.0-p451/bin/teamocil:23:in `<main>'
from teamocil.
Oops sorry, it should work now.
from teamocil.
@thewatts @johnhampton I’m going to close the issue as I believe the issue is now fixed. Feel free to reopen if it’s still not working for you!
from teamocil.
Related Issues (20)
- Teamocil is wiping out GEM_HOME and GEM_PATH HOT 7
- Teamocil throwing error "show-window-options: illegal option -- v"
- Environment variable for `root` does not work HOT 1
- Quoting in yaml
- Example using session HOT 1
- wish: support for XDG_HOME_STANDARD-- put config files under ~/.config
- Feature Request: Recreating panes on changes in the command
- Ability to set environment variables
- Resizing pane? HOT 3
- Feature request: setup commands
- Feature request: generate config from tmux session
- Load ./.teamocil file if no file is provided HOT 3
- Directory per pane HOT 1
- Teamocil does not respect base-index HOT 3
- Domain name dead HOT 1
- Teamocil does not work with Ruby 2.7.0
- Ability to read variables from a variable file in teamocil.
- Custom config path? HOT 2
- Create tmux session instead of editing existing one HOT 1
- Session being renamed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from teamocil.