samoshkin / tmux-config

Tmux configuration, that supercharges your tmux to build cozy and cool terminal environment
2.14k stars 497 forks source link

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

Open liujchen opened 4 years ago

liujchen commented 4 years ago

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

  1. 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 commented 4 years ago

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

60shilling commented 4 years ago

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 commented 3 years ago

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

weberam2 commented 3 years ago

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

dingfanATyykj commented 3 years ago

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

easterwood commented 3 years ago

Thank you for your suggestions.

xuanyuandy commented 3 years ago

Thank you for your suggestions.

Agarethx commented 2 years ago

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

rosharp commented 2 years ago

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

VisComing commented 2 years ago

thanks, it works fine for me

kardusenor commented 2 years ago

Works for me, thanks!

SomanSukale commented 1 year ago

Thanks worked for me

WangberlinT commented 7 months ago

Works for me, thanks!

maksm commented 5 months ago

Worked for me on debian and zsh