tmux-config icon indicating copy to clipboard operation
tmux-config copied to clipboard

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

Open liujchen opened this issue 5 years ago • 15 comments

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 \

liujchen avatar May 23 '20 11:05 liujchen

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

mircsicz avatar May 31 '20 00:05 mircsicz

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.

60shilling avatar Jun 03 '20 02:06 60shilling

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

vedmichv avatar Oct 22 '20 20:10 vedmichv

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

weberam2 avatar Nov 30 '20 16:11 weberam2

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

dingfanATyykj avatar Mar 18 '21 03:03 dingfanATyykj

Thank you for your suggestions.

easterwood avatar Jul 09 '21 05:07 easterwood

Thank you for your suggestions.

xuanyuandy avatar Aug 24 '21 13:08 xuanyuandy

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

Agarethx avatar Oct 29 '21 12:10 Agarethx

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

rosharp avatar Dec 17 '21 08:12 rosharp

thanks, it works fine for me

VisComing avatar Jan 15 '22 10:01 VisComing

Works for me, thanks!

kardusenor avatar May 11 '22 12:05 kardusenor

Thanks worked for me

SomanSukale avatar May 25 '23 09:05 SomanSukale

Works for me, thanks!

WangberlinT avatar Feb 09 '24 04:02 WangberlinT