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

Quoting in yaml #120

Open
imholzj opened this issue Mar 16, 2017 · 1 comment
Open

Quoting in yaml #120

imholzj opened this issue Mar 16, 2017 · 1 comment

Comments

@imholzj
Copy link

imholzj commented Mar 16, 2017

Quoting in the yaml file is a little tricky. The following does not work:

windows:

  • name: "railsprod"
    root: ~
    layout: even-vertical
    panes:
    • ssh server -t 'cd /var/log/rails; bash --login'
    • ssh server -t 'cd /var/rails_apps; bash --login'

If I double quote the ssh command parameter it does work (so I'm good.) But for kicks, I ran this yaml through yamllint.com (I don't know if this is a good resource or not) and got:

windows:

  • name: "railsprod"
    root: ~
    layout: even-vertical
    panes:
    • "ssh server -t 'cd /var/log/rails; bash --login'"
    • "ssh server -t 'cd /var/rails_apps; bash --login'"

and teamocil doesn't like that quoting either.

@ivanterrible
Copy link

recently ran into this issue, if you run teamocil --debug [name of layout] you will see that teamocil wraps single quote around the entire string so using single quotes inside your command mangles the output string resulting in an invalid command. When you need to use single quotes you have to do similar to the following.

 panes:
    - tmux set-hook -p pane-focus-in "if-shell -F '"'"'#{window_zoomed_flag}'"'"' '"'"''"'"' '"'"'resize-pane -Z'"'"'"

in place of

panes:
    - tmux set-hook -p pane-focus-in "if-shell -F '#{window_zoomed_flag}' '' 'resize-pane -Z'"

So any single quotes would then need to be replaced by '"'"'.

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