Giter Club home page Giter Club logo

Comments (12)

toobulkeh avatar toobulkeh commented on May 24, 2024

👍 for this issue.

from teamocil.

Cyborg572 avatar Cyborg572 commented on May 24, 2024

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.

Cyborg572 avatar Cyborg572 commented on May 24, 2024

Oh, never mind. It looks like #53 added the focus option for windows. @toobulkeh Try updating the gem, that worked for me.

from teamocil.

remi avatar remi commented on May 24, 2024

@thewatts Can you test it with teamocil 1.0 please? Thanks!

from teamocil.

johnhampton avatar johnhampton commented on May 24, 2024

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.

thewatts avatar thewatts commented on May 24, 2024

@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.

remi avatar remi commented on May 24, 2024

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.

johnhampton avatar johnhampton commented on May 24, 2024

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.

remi avatar remi commented on May 24, 2024

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.

johnhampton avatar johnhampton commented on May 24, 2024

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.

remi avatar remi commented on May 24, 2024

Oops sorry, it should work now.

from teamocil.

remi avatar remi commented on May 24, 2024

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.