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

.tmux.conf:41: syntax error and .tmux.conf:100: unknown key: if #38

Open
liujchen opened this issue May 23, 2020 · 14 comments
Open

.tmux.conf:41: syntax error and .tmux.conf:100: unknown key: if #38

liujchen opened this issue May 23, 2020 · 14 comments

Comments

@liujchen
Copy link

liujchen commented May 23, 2020

Thanks for this awesome config file.
I have two issues with my Mac (Majave 10.14.6 ) setup.

unbind }    # swap-pane -D
unbind {    # swap-pane -U

/Users/liuj1/.tmux.conf:41: syntax error

if I commented line 41, then I have

/Users/liuj1/.tmux.conf:42: syntax error

It has syntax error, but if I add \ like below, it has no error, had look with previous bugs seem it is mentioned something similar

unbind \}    # swap-pane -D
unbind \{    # swap-pane -U
  1. This line not working
bind \ if '[ #{pane_index} -eq 1 ]' \
     'swap-pane -s "!"' \
     'select-pane -t:.1 ; swap-pane -d -t 1 -s "!"'

It complains:

/Users/liuj1/.tmux.conf:100: unknown key: if

I add \ like below, and it returns no error.

bind \\ if '[ #{pane_index} -eq 1 ]' \
     'swap-pane -s "!"' \
     'select-pane -t:.1 ; swap-pane -d -t 1 -s "!"'

After I got these 2 changed, the rest works fine.

It looks like with my Mac, need to escape { } and \

@mircsicz
Copy link

Thanks a ton fixed it for me on 10.15.5 using iterm2 and zsh ;-)

@60shilling
Copy link

on Kubuntu 20.04, using konsole I had very similar problems.
the above two suggestions fixed 2 of 3 issues.
the 3rd was a custom vertical split (C-a \ ) I was using : C-a | , is std.
I tried escaping it with another \ but that failed, so I just resorted to binding i .
makes sense to me.
thanks for previous efforts : made my life much easier.

@vedmichv
Copy link

On my Mac with MacOS v11.0 (Big Sur)
I am using iterm2 and zsh

@weberam2
Copy link

Same and suggestions worked. Thank you!
Ubuntu 20.04
Bash-it

@dingfanATyykj
Copy link

Works for me, thanks!
This should be added to the repo :|

@easterwood
Copy link

Thank you for your suggestions.

1 similar comment
@xuanyuandy
Copy link

Thank you for your suggestions.

0xB0000xDEAD added a commit to 0xB0000xDEAD/tmux-config that referenced this issue Sep 2, 2021
NightFuryS9 added a commit to NightFuryS9/tmux-config that referenced this issue Sep 16, 2021
benjibobs added a commit to benjibobs/tmux-config that referenced this issue Sep 27, 2021
akhan3 added a commit to akhan3/tmux-config that referenced this issue Oct 3, 2021
@Agarethx
Copy link

I had de same problem with osx big sur, this fix works perfectly.
Thanks

@rosharp
Copy link

rosharp commented Dec 17, 2021

After these fixes works perfectly. I am on MacOS using ZSH in iTerm2/Alacritty.

@VisComing
Copy link

thanks, it works fine for me

@kardusenor
Copy link

Works for me, thanks!

actiago added a commit to actiago/dotfiles that referenced this issue Dec 23, 2022
@SomanSukale
Copy link

Thanks worked for me

@WangberlinT
Copy link

Works for me, thanks!

@maksm
Copy link

maksm commented Mar 13, 2024

Worked for me on debian and zsh

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