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

Layout option / panes not being sent through to tmux #629

Closed
JonRowe opened this issue May 29, 2018 · 5 comments
Closed

Layout option / panes not being sent through to tmux #629

JonRowe opened this issue May 29, 2018 · 5 comments

Comments

@JonRowe
Copy link
Contributor

JonRowe commented May 29, 2018

Using the latest version of tmuxinator 0.11.2, panes and layout for a window doesn't do anything, project file:

project_name: td
project_root: ~/Code/TheProject/Dashboard
windows:
  - editor: vim
  - shell:
    layout: main-vertical
    panes:
      - git status
      - yarn run

Output:

#!/bin/bash

# Clear rbenv variables before starting tmux
unset RBENV_VERSION
unset RBENV_DIR

tmux start-server;

cd /Users/jon/Code/TheProject/Dashboard

# Run on_project_start command.


  # Run on_project_restart command.
  

  if [ -z "$TMUX" ]; then
    tmux -u attach-session -t td
  else
    tmux -u switch-client -t td
  fi


    
# Run on_project_exit command.
@ethagnawl
Copy link
Member

Hi, @JonRowe.

Is this a new config file or is it one that was previously working and broke after upgrading to 0.11.2?

If it's a new config file, I think it's a whitespace issue. There are known problems with tmuxinator and whitespace, particularly with two space indentations (see #489).

Changing your sample to the following (which uses four space indentations) works as expected on my machine:

# ~/.tmuxinator/bug-y.yml

project_name: bug-y
project_root: ~/projects/tmuxinator
windows:
    - editor: vim
    - shell:
        layout: main-vertical
        panes:
            - git status
            - yarn run

I would love to get the whitespace issue sorted and, thanks to this report, it's back on my radar.

If this was a working config file which stopped working after the upgrade, that will require some additional investigation.

@JonRowe
Copy link
Contributor Author

JonRowe commented May 29, 2018

Ah yes, the whitespace was the issue, would you accept a PR noting this on the read me?

@ethagnawl
Copy link
Member

That would be greatly appreciated.

@ethagnawl
Copy link
Member

ethagnawl commented May 30, 2018

So, @JonRowe. I've determined this issue is actually YAML's fault. It's a quirk in how it handles the indentation of list/dictionary elements. Specifically, where the indentation actually begins. I've yet to find a definitive source (e.g. in the YAML spec) but I have found references to this issue in a few places.

Notice that while the indentation is two spaces per level, for the values under the context and defaults options there is a four-space indent. If only two spaces are used to indent, then those keys will be considered part of the same dictionary that contains the context key, and so the data will not be loaded correctly.

https://docs.saltstack.com/en/2017.7/topics/troubleshooting/yaml_idiosyncrasies.html

Block list items can (but don't need to) have the same indentation as the surrounding block level because "-" is considered part of the indentation

https://stackoverflow.com/a/42248984/382982

My own SO question about your use case.

I'm looking forward to seeing how you address this is your PR. Thanks, again, for the offer!

@ethagnawl
Copy link
Member

Closed via #630.

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

2 participants