Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Teamocil does not respect base-index #135

Open
kylebarbour opened this issue Jan 23, 2020 · 3 comments
Open

Teamocil does not respect base-index #135

kylebarbour opened this issue Jan 23, 2020 · 3 comments

Comments

@kylebarbour
Copy link

kylebarbour commented Jan 23, 2020

When run from within an existing tmux session, Teamocil behaves as expected by opening a new window at the next available index number, and so no issue exists. However, when run at the start of a new session, Teamocil opens the first window at index 1, rather than the setting of base-index (default 0). This is an issue as it breaks expected behavior, particularly in that creating a new window within that tmux session will index it at 0, while you would naturally expect that window to be indexed in sequence.

Steps to reproduce:

  1. Create a basic Teamocil configuration file (~/.teamocil/test.yml):
windows:
  - name: test
  1. Create a new tmux session running Teamocil:
    $ tmux new-session "teamocil test"
  2. Note that this creates a new session with a single window with index 1 rather than 0.

System information:

$ tmux -V
tmux 2.6
$ teamocil --version
1.4.2
$ lsb_release -d
Description:	Ubuntu 18.04.3 LTS
$ uname -sr
Linux 4.15.0-74-generic
@remi
Copy link
Owner

remi commented Jan 24, 2020

Hi Kyle,

Thank you for the bug report. I never use tmux new-session <command> so this is new to me. However, I’m not able to reproduce the bug on my system.

If I have base-index set to 0, running tmux new-session "teamocil test" creates a session with its only window at index 0.

If I have base-index set to 1, running tmux new-session "teamocil test" creates a session with its only window at index 1.

This line in Teamocil::Tmux::Window makes sure we use the correct base index from Tmux configuration.

My system information:

$ tmux -V
tmux 3.0
$ teamocil --version
1.4.2
$ uname -sr
Darwin 19.2.0

Can you try with a newer tmux version?

Thank you!

@kylebarbour
Copy link
Author

kylebarbour commented Feb 2, 2020

Hey remi, thanks for the reply!

I just built the latest source and have the same problem.

$ git clone https://github.com/tmux/tmux.git && cd tmux
$ sh autogen.sh
$ ./configure
$ make
$ sudo make install
$ which tmux
/usr/local/bin/tmux
$ tmux -V
tmux next-3.1

Interestingly, it seems that teamocil does respect base-index. However, the window numbering is still offset by 1. In other words, if base-index is 0, the windows start at 1; if it is 1, then 2; if it is 8, then the windows start at 9.

This occurs with a minimal ~/.tmux.conf that only contains set -g base-index N.

@laureanray
Copy link

I'm still encountering this issue using the minimal configuration of Teamocil. Can I work on this? @remi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants