gpakosz / .tmux

🇫🇷 Oh my tmux! My self-contained, pretty & versatile tmux configuration made with ❤️
MIT License
22.04k stars 3.37k forks source link

Error applying configuration since last changes #89

Closed luisdavim closed 7 years ago

luisdavim commented 7 years ago

Hi,

I've updated from git today any now I'm getting this:

cut -c3- ~/.tmux.conf | sh -s _apply_configuration
sh: eval: line 703: unexpected EOF while looking for matching `"
gpakosz commented 7 years ago

Which tmux version?

luisdavim commented 7 years ago

I 'm running tmux 2.5 on macOS installed with homebrew.

gpakosz commented 7 years ago

Can you please paste the output for tmux list-keys?

luisdavim commented 7 years ago

It's quite long, I created a gist for it: https://gist.github.com/luisdavim/6c7afd61a5707d6fcebb2bee1cd2b1f8

luisdavim commented 7 years ago

I think it was a problem with my local conf. It's fixed since I synced it with the new version on this repo.

These were the differences: https://gist.github.com/luisdavim/52747583aa3ac58f1fc3447681116d7a

Thanks for your help and quick reply.

gpakosz commented 7 years ago

Hmm I see nothing in the ~/.tmux.conf.local diff that could explain what you were facing though.

luisdavim commented 7 years ago

The only thing is that I was missing tmux_conf_copy_to_os_clipboard=false

gpakosz commented 7 years ago

What about your ~/.tmux.conf, does it diverge from mine?

luisdavim commented 7 years ago

no, that one is a symlink to yours, I git clone this repo to ~/.tmux/ create the link and have my own .local file

gpakosz commented 7 years ago

I'm asking because e.g. in the gist you linked, the following line doesn't come from my conf nor is a tmux default afaik:

bind-key    -T copy-mode    C-o               send-keys -X copy-pipe-and-cancel "xargs -I {} tmux send-keys '/usr/bin/vim -- \"{}\"'; tmux send-keys 'C-m'"

What you're facing / you faced is my conf failing to parse an existing binding and now I'm intrigued what exact binding it is :)

luisdavim commented 7 years ago

The diff I pasted is not the diff from your version it's the diff from my previous version. you can see my full tmux.conf.local here: https://github.com/luisdavim/dotfiles/blob/master/files/tmux.conf.local

gpakosz commented 7 years ago

Thanks, going to analyze what's going on later

luisdavim commented 7 years ago

it's probably a conflict with the copycat plugin.

gpakosz commented 7 years ago

Well I indeed don't plan to replicate your whole TPM setup as I don't use TPM myself.

Though what we can do is:

  1. keep your ~/.tmux.conf.local
  2. remove lines 688-714 from my ~/.tmux.conf
  3. restart tmux (killall server and client)
  4. paste the output of tmux list-keys

At that point I should see what the copycat plugin did to bindings and I can make my binding parsing more robust

luisdavim commented 7 years ago

I've updated the gist with both outputs and a diff: https://gist.github.com/luisdavim/6c7afd61a5707d6fcebb2bee1cd2b1f8

gpakosz commented 7 years ago

It's kind of tricky because the copy cat plugin injects copy-pipe(-and-cancel)? bindings which tmux_conf_copy_to_os_clipboard=false tries to remove.

And tmux_conf_copy_to_os_clipboard=false has to remove some because otherwise you can't ping-pong between tmux_conf_copy_to_os_clipboard=true and tmux_conf_copy_to_os_clipboard=false settings without killing the tmux server

luisdavim commented 7 years ago

if your configuration provides this feature I'm happy to stop using copycat...

jtr109 commented 7 years ago

Hi, @gpakosz . You config is awesome! Could you please answer my question? Is that true that the variable assignment in tmux twice will make a conflict, not using the value setted later? Such as tmux_conf_copy_to_os_clipboard=true and tmux_conf_copy_to_os_clipboard=false together. I met the problem when I wanted to created a custom config file based on yours. Thanks a lot!

gpakosz commented 7 years ago

@luisdavim is tmux_keys_no_copy.txt the bindings when you remove lines 688-714?

gpakosz commented 7 years ago

In tmux_keys_no_copy.txt there's no trace of bindings making use of xargs for example so I'm wondering how you produced that list.

luisdavim commented 7 years ago

The lines 688 to 714 would include the beginning of the _apply_theme function so I removed only up to line 706, this block:

#   tmux_conf_copy_to_os_clipboard=${tmux_conf_copy_to_os_clipboard:-false}
#   command -v pbcopy > /dev/null 2>&1 && command='pbcopy'
#   command -v reattach-to-user-namespace > /dev/null 2>&1 && command='reattach-to-user-namespace pbcopy'
#   command -v xsel > /dev/null 2>&1 && command='xsel -i -b'
#   ! command -v xsel > /dev/null 2>&1 && command -v xclip > /dev/null 2>&1 && command='xclip -i -selection clipboard > /dev/null 2>&1'
#   command -v clip.exe > /dev/null 2>&1 && command='clip\.exe'
#   [ -c /dev/clipboard ] && command='cat > \/dev\/clipboard'
#
#   # shellcheck disable=SC2086
#   for table in "" "-t emacs-copy" "-t vi-copy"; do
#     line=$(tmux list-keys $table 2>/dev/null | grep -e 'copy-selection\|copy-pipe' | head -1)
#     prefix=${line%copy-*}
#     column=${#prefix}
#
#     while IFS= read -r line; do
#       [ -z "$line" ] && continue
#       left=$(echo "$line" | cut -c-"$column" | sed -E -e 's/[^ \ta-zA-Z0-9,._+@%/-]/\\&/g')
#       if _is_enabled "$tmux_conf_copy_to_os_clipboard"; then
#         right=$(echo "$line" | cut -c"$column"- | awk -F'\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }' | sed -E -e "s/copy-selection(-and-cancel)?$/copy-pipe\1 \"$command\"/g")
#       else
#         right=$(echo "$line" | cut -c"$column"- | awk -F'\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }' | sed -E -e "s/copy-pipe(-and-cancel)? \"$command\"$/copy-selection\1/g")
#       fi
#       eval "tmux $left $right"
#     done  << EOF
# $(tmux list-keys $table 2>/dev/null | grep -e 'copy-selection\|copy-pipe')
# EOF
#   done
gpakosz commented 7 years ago

Yeah sure 706, my bad. Still was copycat plugin enabled when you listed bindings?

luisdavim commented 7 years ago

yes, I didn't touch the local config.

gpakosz commented 7 years ago

I don't get it then.

When you comment lines in ~/.tmux.conf the purpose is to prevent erroneous modifications from my part.

But I would expect copycat to have changed/added bindings, typically the ones with xargs in them

gpakosz commented 7 years ago

Or is it the other way around? is it the copy-cat plugin messing with bindings I applied?

gpakosz commented 7 years ago

I just gave it another look and I still don't understand what's going on.

When I look at https://github.com/luisdavim/dotfiles/blob/master/files/tmux.conf.local#L288-L308 the lines are commented out.

How is tpm and its plugins initialized then?

luisdavim commented 7 years ago

I commented those out today after we spoke.

gpakosz commented 7 years ago

Well, tell me when you can reproduce the problem on your side and we can instrument ~/.tmux.conf together

aidanharris commented 7 years ago

This doesn't apply for me anymore either. I haven't git pulled in a while so the last commit I have (that works) is 95f88dee38d2339d0bbb95ae954d26a9db7a3553. If I have some time I'll try to play about with git bisect and see if I can find what broke it.

I'm using tmux 2.5 on Archlinux.

gpakosz commented 7 years ago

@aidanharris This is the commit that introduces parsing existing bindings and altering them depending on options

commit 7f48779a22ad3b440561762c2cd55ef89618f548
Author: Gregory Pakosz <gregory.pakosz@gmail.com>
Date:   Thu May 25 15:15:45 2017 +0200

    generalized options affecting bindings by parsing the output of tmux list-keys
    and reinjecting modified commands into tmux bind-key, closes #68

    applies to:
    - tmux_conf_new_window_retain_current_path
    - tmux_conf_new_pane_retain_current_path
    - tmux_conf_new_pane_reconnect_ssh
    - tmux_conf_copy_to_os_clipboard

So there's no need to bisect imho.

@aidanharris If you want to help me, can you please do the following?

In ~/.tmux.conf, everywhere it applies, replace

eval "tmux $left $right"

with

eval "tmux $left $right" 2>/dev/null || echo "$line" >> /tmp/failures.txt

And paste the content of the file. Thanks!

aidanharris commented 7 years ago

@gpakosz Nothing's logged to /tmp/failures.txt at all! It's almost as if tmux is completely ignoring the config altogether 😕

gpakosz commented 7 years ago

@aidanharris Hmm well then please try the commit right before the one I mentioned and please paste the output of tmux list-keys

gpakosz commented 7 years ago

@aidanharris are you also using tpm btw?

aidanharris commented 7 years ago

@gpakosz I'm not using tpm. The only thing I can think of that could possibly conflict is my shell (zsh+oh-my-zsh), although I don't think that's the issue.

> tmux list-keys
bind-key    -T copy-mode    C-Space           send-keys -X begin-selection
bind-key    -T copy-mode    C-a               send-keys -X start-of-line
bind-key    -T copy-mode    C-b               send-keys -X cursor-left
bind-key    -T copy-mode    C-c               send-keys -X cancel
bind-key    -T copy-mode    C-e               send-keys -X end-of-line
bind-key    -T copy-mode    C-f               send-keys -X cursor-right
bind-key    -T copy-mode    C-g               send-keys -X clear-selection
bind-key    -T copy-mode    C-k               send-keys -X copy-end-of-line
bind-key    -T copy-mode    C-n               send-keys -X cursor-down
bind-key    -T copy-mode    C-p               send-keys -X cursor-up
bind-key    -T copy-mode    C-r               command-prompt -i -p "search up" "send -X search-backward-incremental \"%%%\""
bind-key    -T copy-mode    C-s               command-prompt -i -p "search down" "send -X search-forward-incremental \"%%%\""
bind-key    -T copy-mode    C-v               send-keys -X page-down
bind-key    -T copy-mode    C-w               send-keys -X copy-selection-and-cancel
bind-key    -T copy-mode    Escape            send-keys -X cancel
bind-key    -T copy-mode    Space             send-keys -X page-down
bind-key    -T copy-mode    ,                 send-keys -X jump-reverse
bind-key    -T copy-mode    ;                 send-keys -X jump-again
bind-key    -T copy-mode    F                 command-prompt -1 -p "jump backward" "send -X jump-backward \"%%%\""
bind-key    -T copy-mode    N                 send-keys -X search-reverse
bind-key    -T copy-mode    R                 send-keys -X rectangle-toggle
bind-key    -T copy-mode    T                 command-prompt -1 -p "jump to backward" "send -X jump-to-backward \"%%%\""
bind-key    -T copy-mode    f                 command-prompt -1 -p "jump forward" "send -X jump-forward \"%%%\""
bind-key    -T copy-mode    g                 command-prompt -p "goto line" "send -X goto-line \"%%%\""
bind-key    -T copy-mode    n                 send-keys -X search-again
bind-key    -T copy-mode    q                 send-keys -X cancel
bind-key    -T copy-mode    t                 command-prompt -1 -p "jump to forward" "send -X jump-to-forward \"%%%\""
bind-key    -T copy-mode    MouseDown1Pane    select-pane
bind-key    -T copy-mode    MouseDrag1Pane    select-pane ; send-keys -X begin-selection
bind-key    -T copy-mode    MouseDragEnd1Pane send-keys -X copy-selection-and-cancel
bind-key    -T copy-mode    WheelUpPane       select-pane ; send-keys -X -N 5 scroll-up
bind-key    -T copy-mode    WheelDownPane     select-pane ; send-keys -X -N 5 scroll-down
bind-key    -T copy-mode    DoubleClick1Pane  select-pane ; send-keys -X select-word
bind-key    -T copy-mode    TripleClick1Pane  select-pane ; send-keys -X select-line
bind-key    -T copy-mode    Home              send-keys -X start-of-line
bind-key    -T copy-mode    End               send-keys -X end-of-line
bind-key    -T copy-mode    NPage             send-keys -X page-down
bind-key    -T copy-mode    PPage             send-keys -X page-up
bind-key    -T copy-mode    Up                send-keys -X cursor-up
bind-key    -T copy-mode    Down              send-keys -X cursor-down
bind-key    -T copy-mode    Left              send-keys -X cursor-left
bind-key    -T copy-mode    Right             send-keys -X cursor-right
bind-key    -T copy-mode    M-1               command-prompt -N -I 1 -p repeat "send -N \"%%%\""
bind-key    -T copy-mode    M-2               command-prompt -N -I 2 -p repeat "send -N \"%%%\""
bind-key    -T copy-mode    M-3               command-prompt -N -I 3 -p repeat "send -N \"%%%\""
bind-key    -T copy-mode    M-4               command-prompt -N -I 4 -p repeat "send -N \"%%%\""
bind-key    -T copy-mode    M-5               command-prompt -N -I 5 -p repeat "send -N \"%%%\""
bind-key    -T copy-mode    M-6               command-prompt -N -I 6 -p repeat "send -N \"%%%\""
bind-key    -T copy-mode    M-7               command-prompt -N -I 7 -p repeat "send -N \"%%%\""
bind-key    -T copy-mode    M-8               command-prompt -N -I 8 -p repeat "send -N \"%%%\""
bind-key    -T copy-mode    M-9               command-prompt -N -I 9 -p repeat "send -N \"%%%\""
bind-key    -T copy-mode    M-<               send-keys -X history-top
bind-key    -T copy-mode    M->               send-keys -X history-bottom
bind-key    -T copy-mode    M-R               send-keys -X top-line
bind-key    -T copy-mode    M-b               send-keys -X previous-word
bind-key    -T copy-mode    M-f               send-keys -X next-word-end
bind-key    -T copy-mode    M-m               send-keys -X back-to-indentation
bind-key    -T copy-mode    M-r               send-keys -X middle-line
bind-key    -T copy-mode    M-v               send-keys -X page-up
bind-key    -T copy-mode    M-w               send-keys -X copy-selection-and-cancel
bind-key    -T copy-mode    M-{               send-keys -X previous-paragraph
bind-key    -T copy-mode    M-}               send-keys -X next-paragraph
bind-key    -T copy-mode    M-Up              send-keys -X halfpage-up
bind-key    -T copy-mode    M-Down            send-keys -X halfpage-down
bind-key    -T copy-mode    C-Up              send-keys -X scroll-up
bind-key    -T copy-mode    C-Down            send-keys -X scroll-down
bind-key    -T copy-mode-vi C-b               send-keys -X page-up
bind-key    -T copy-mode-vi C-c               send-keys -X cancel
bind-key    -T copy-mode-vi C-d               send-keys -X halfpage-down
bind-key    -T copy-mode-vi C-e               send-keys -X scroll-down
bind-key    -T copy-mode-vi C-f               send-keys -X page-down
bind-key    -T copy-mode-vi C-h               send-keys -X cursor-left
bind-key    -T copy-mode-vi C-j               send-keys -X copy-selection-and-cancel
bind-key    -T copy-mode-vi Enter             send-keys -X copy-selection-and-cancel
bind-key    -T copy-mode-vi C-u               send-keys -X halfpage-up
bind-key    -T copy-mode-vi C-v               send-keys -X rectangle-toggle
bind-key    -T copy-mode-vi C-y               send-keys -X scroll-up
bind-key    -T copy-mode-vi Escape            send-keys -X cancel
bind-key    -T copy-mode-vi Space             send-keys -X begin-selection
bind-key    -T copy-mode-vi $                 send-keys -X end-of-line
bind-key    -T copy-mode-vi ,                 send-keys -X jump-reverse
bind-key    -T copy-mode-vi /                 command-prompt -p "search down" "send -X search-forward \"%%%\""
bind-key    -T copy-mode-vi 0                 send-keys -X start-of-line
bind-key    -T copy-mode-vi 1                 command-prompt -N -I 1 -p repeat "send -N \"%%%\""
bind-key    -T copy-mode-vi 2                 command-prompt -N -I 2 -p repeat "send -N \"%%%\""
bind-key    -T copy-mode-vi 3                 command-prompt -N -I 3 -p repeat "send -N \"%%%\""
bind-key    -T copy-mode-vi 4                 command-prompt -N -I 4 -p repeat "send -N \"%%%\""
bind-key    -T copy-mode-vi 5                 command-prompt -N -I 5 -p repeat "send -N \"%%%\""
bind-key    -T copy-mode-vi 6                 command-prompt -N -I 6 -p repeat "send -N \"%%%\""
bind-key    -T copy-mode-vi 7                 command-prompt -N -I 7 -p repeat "send -N \"%%%\""
bind-key    -T copy-mode-vi 8                 command-prompt -N -I 8 -p repeat "send -N \"%%%\""
bind-key    -T copy-mode-vi 9                 command-prompt -N -I 9 -p repeat "send -N \"%%%\""
bind-key    -T copy-mode-vi :                 command-prompt -p "goto line" "send -X goto-line \"%%%\""
bind-key    -T copy-mode-vi ;                 send-keys -X jump-again
bind-key    -T copy-mode-vi ?                 command-prompt -p "search up" "send -X search-backward \"%%%\""
bind-key    -T copy-mode-vi A                 send-keys -X append-selection-and-cancel
bind-key    -T copy-mode-vi B                 send-keys -X previous-space
bind-key    -T copy-mode-vi D                 send-keys -X copy-end-of-line
bind-key    -T copy-mode-vi E                 send-keys -X next-space-end
bind-key    -T copy-mode-vi F                 command-prompt -1 -p "jump backward" "send -X jump-backward \"%%%\""
bind-key    -T copy-mode-vi G                 send-keys -X history-bottom
bind-key    -T copy-mode-vi H                 send-keys -X top-line
bind-key    -T copy-mode-vi J                 send-keys -X scroll-down
bind-key    -T copy-mode-vi K                 send-keys -X scroll-up
bind-key    -T copy-mode-vi L                 send-keys -X end-of-line
bind-key    -T copy-mode-vi M                 send-keys -X middle-line
bind-key    -T copy-mode-vi N                 send-keys -X search-reverse
bind-key    -T copy-mode-vi T                 command-prompt -1 -p "jump to backward" "send -X jump-to-backward \"%%%\""
bind-key    -T copy-mode-vi V                 send-keys -X select-line
bind-key    -T copy-mode-vi W                 send-keys -X next-space
bind-key    -T copy-mode-vi ^                 send-keys -X back-to-indentation
bind-key    -T copy-mode-vi b                 send-keys -X previous-word
bind-key    -T copy-mode-vi e                 send-keys -X next-word-end
bind-key    -T copy-mode-vi f                 command-prompt -1 -p "jump forward" "send -X jump-forward \"%%%\""
bind-key    -T copy-mode-vi g                 send-keys -X history-top
bind-key    -T copy-mode-vi h                 send-keys -X cursor-left
bind-key    -T copy-mode-vi j                 send-keys -X cursor-down
bind-key    -T copy-mode-vi k                 send-keys -X cursor-up
bind-key    -T copy-mode-vi l                 send-keys -X cursor-right
bind-key    -T copy-mode-vi n                 send-keys -X search-again
bind-key    -T copy-mode-vi o                 send-keys -X other-end
bind-key    -T copy-mode-vi q                 send-keys -X cancel
bind-key    -T copy-mode-vi t                 command-prompt -1 -p "jump to forward" "send -X jump-to-forward \"%%%\""
bind-key    -T copy-mode-vi v                 send-keys -X begin-selection
bind-key    -T copy-mode-vi w                 send-keys -X next-word
bind-key    -T copy-mode-vi y                 send-keys -X copy-selection
bind-key    -T copy-mode-vi {                 send-keys -X previous-paragraph
bind-key    -T copy-mode-vi }                 send-keys -X next-paragraph
bind-key    -T copy-mode-vi MouseDown1Pane    select-pane
bind-key    -T copy-mode-vi MouseDrag1Pane    select-pane ; send-keys -X begin-selection
bind-key    -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-selection-and-cancel
bind-key    -T copy-mode-vi WheelUpPane       select-pane ; send-keys -X -N 5 scroll-up
bind-key    -T copy-mode-vi WheelDownPane     select-pane ; send-keys -X -N 5 scroll-down
bind-key    -T copy-mode-vi DoubleClick1Pane  select-pane ; send-keys -X select-word
bind-key    -T copy-mode-vi TripleClick1Pane  select-pane ; send-keys -X select-line
bind-key    -T copy-mode-vi BSpace            send-keys -X cursor-left
bind-key    -T copy-mode-vi NPage             send-keys -X page-down
bind-key    -T copy-mode-vi PPage             send-keys -X page-up
bind-key    -T copy-mode-vi Up                send-keys -X cursor-up
bind-key    -T copy-mode-vi Down              send-keys -X cursor-down
bind-key    -T copy-mode-vi Left              send-keys -X cursor-left
bind-key    -T copy-mode-vi Right             send-keys -X cursor-right
bind-key    -T copy-mode-vi C-Up              send-keys -X scroll-up
bind-key    -T copy-mode-vi C-Down            send-keys -X scroll-down
bind-key    -T prefix       C-a               send-prefix -2
bind-key    -T prefix       C-b               send-prefix
bind-key    -T prefix       C-c               new-session
bind-key    -T prefix       C-f               command-prompt -p find-session "switch-client -t %%"
bind-key -r -T prefix       C-h               previous-window
bind-key    -T prefix       Tab               last-window
bind-key -r -T prefix       C-l               next-window
bind-key    -T prefix       Enter             copy-mode
bind-key    -T prefix       C-o               rotate-window
bind-key    -T prefix       C-z               suspend-client
bind-key    -T prefix       Space             next-layout
bind-key    -T prefix       !                 break-pane
bind-key    -T prefix       "                 split-window -v -c "#{pane_current_path}"
bind-key    -T prefix       #                 list-buffers
bind-key    -T prefix       $                 command-prompt -I "#S" "rename-session '%%'"
bind-key    -T prefix       %                 split-window -h -c "#{pane_current_path}"
bind-key    -T prefix       &                 confirm-before -p "kill-window #W? (y/n)" kill-window
bind-key    -T prefix       '                 command-prompt -p index "select-window -t ':%%'"
bind-key    -T prefix       (                 switch-client -p
bind-key    -T prefix       )                 switch-client -n
bind-key    -T prefix       +                 run-shell "cut -c3- ~/.tmux.conf | sh -s _maximize_pane #{session_name} #D"
bind-key    -T prefix       ,                 command-prompt -I "#W" "rename-window '%%'"
bind-key    -T prefix       -                 split-window -v -c "#{pane_current_path}"
bind-key    -T prefix       .                 command-prompt "move-window -t '%%'"
bind-key    -T prefix       0                 select-window -t :=0
bind-key    -T prefix       1                 select-window -t :=1
bind-key    -T prefix       2                 select-window -t :=2
bind-key    -T prefix       3                 select-window -t :=3
bind-key    -T prefix       4                 select-window -t :=4
bind-key    -T prefix       5                 select-window -t :=5
bind-key    -T prefix       6                 select-window -t :=6
bind-key    -T prefix       7                 select-window -t :=7
bind-key    -T prefix       8                 select-window -t :=8
bind-key    -T prefix       9                 select-window -t :=9
bind-key    -T prefix       :                 command-prompt
bind-key    -T prefix       ;                 last-pane
bind-key    -T prefix       <                 swap-pane -U
bind-key    -T prefix       =                 choose-buffer
bind-key    -T prefix       >                 swap-pane -D
bind-key    -T prefix       ?                 list-keys
bind-key    -T prefix       D                 choose-client
bind-key    -T prefix       F                 run-shell "cut -c3- ~/.tmux.conf | sh -s _fpp #{pane_id}"
bind-key -r -T prefix       H                 resize-pane -L 2
bind-key -r -T prefix       J                 resize-pane -D 2
bind-key -r -T prefix       K                 resize-pane -U 2
bind-key -r -T prefix       L                 resize-pane -R 2
bind-key    -T prefix       M                 select-pane -M
bind-key    -T prefix       P                 choose-buffer
bind-key    -T prefix       U                 run-shell "cut -c3- ~/.tmux.conf | sh -s _urlview #{pane_id}"
bind-key    -T prefix       [                 copy-mode
bind-key    -T prefix       ]                 paste-buffer
bind-key    -T prefix       _                 split-window -h -c "#{pane_current_path}"
bind-key    -T prefix       b                 list-buffers
bind-key    -T prefix       c                 new-window
bind-key    -T prefix       d                 detach-client
bind-key    -T prefix       e                 new-window -n ~/.tmux.conf.local "sh -c '${EDITOR:-vim} ~/.tmux.conf.local && tmux source ~/.tmux.conf && tmux display \"~/.tmux.conf sourced\"'"
bind-key    -T prefix       f                 command-prompt "find-window '%%'"
bind-key -r -T prefix       h                 select-pane -L
bind-key    -T prefix       i                 display-message
bind-key -r -T prefix       j                 select-pane -D
bind-key -r -T prefix       k                 select-pane -U
bind-key -r -T prefix       l                 select-pane -R
bind-key    -T prefix       m                 run-shell "cut -c3- ~/.tmux.conf | sh -s _toggle_mouse"
bind-key    -T prefix       o                 select-pane -t :.+
bind-key    -T prefix       p                 paste-buffer
bind-key    -T prefix       q                 display-panes
bind-key    -T prefix       r                 source-file /home/aidan/.tmux.conf ; display-message "~/.tmux.conf sourced"
bind-key    -T prefix       s                 choose-tree
bind-key    -T prefix       t                 clock-mode
bind-key    -T prefix       w                 choose-window
bind-key    -T prefix       x                 confirm-before -p "kill-pane #P? (y/n)" kill-pane
bind-key    -T prefix       y                 run-shell -b "tmux save-buffer - | xclip -i -selection clipboard >/dev/null 2>&1"
bind-key    -T prefix       z                 resize-pane -Z
bind-key    -T prefix       {                 swap-pane -U
bind-key    -T prefix       }                 swap-pane -D
bind-key    -T prefix       ~                 show-messages
bind-key    -T prefix       PPage             copy-mode -u
bind-key -r -T prefix       Up                select-pane -U
bind-key -r -T prefix       Down              select-pane -D
bind-key -r -T prefix       Left              select-pane -L
bind-key -r -T prefix       Right             select-pane -R
bind-key    -T prefix       M-1               select-layout even-horizontal
bind-key    -T prefix       M-2               select-layout even-vertical
bind-key    -T prefix       M-3               select-layout main-horizontal
bind-key    -T prefix       M-4               select-layout main-vertical
bind-key    -T prefix       M-5               select-layout tiled
bind-key    -T prefix       M-n               next-window -a
bind-key    -T prefix       M-o               rotate-window -D
bind-key    -T prefix       M-p               previous-window -a
bind-key -r -T prefix       M-Up              resize-pane -U 5
bind-key -r -T prefix       M-Down            resize-pane -D 5
bind-key -r -T prefix       M-Left            resize-pane -L 5
bind-key -r -T prefix       M-Right           resize-pane -R 5
bind-key -r -T prefix       C-Up              resize-pane -U
bind-key -r -T prefix       C-Down            resize-pane -D
bind-key -r -T prefix       C-Left            resize-pane -L
bind-key -r -T prefix       C-Right           resize-pane -R
bind-key    -T root         C-l               send-keys C-l ; run-shell "sleep 0.05 && tmux clear-history"
bind-key    -T root         MouseDown1Pane    select-pane -t = ; send-keys -M
bind-key    -T root         MouseDown1Status  select-window -t =
bind-key    -T root         MouseDown3Pane    if-shell -F -t = "#{mouse_any_flag}" "select-pane -t=; send-keys -M" "select-pane -mt="
bind-key    -T root         MouseDrag1Pane    if-shell -F -t = "#{mouse_any_flag}" "if -Ft= \"#{pane_in_mode}\" \"copy-mode -M\" \"send-keys -M\"" "copy-mode -M"
bind-key    -T root         MouseDrag1Border  resize-pane -M
bind-key    -T root         WheelUpPane       if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= \"#{pane_in_mode}\" \"send-keys -M\" \"copy-mode -et=\""
bind-key    -T root         WheelUpStatus     previous-window
bind-key    -T root         WheelDownStatus   next-window

This is the output of tmux list-keys from commit 264a577ba183bf7ce74da22a18fbb1bdba8244bf

gpakosz commented 7 years ago

Thanks, and while I start looking into it, can you confirm 7f48779a22ad3b440561762c2cd55ef89618f548 breaks it?

aidanharris commented 7 years ago

@gpakosz Yep, that commit definitely breaks it.

gpakosz commented 7 years ago

@aidanharris Also, I would like to know the error you're seeing, same eval error as @luisdavim ?

aidanharris commented 7 years ago

@gpakosz I'm not seeing any eval errors at all. Tmux just doesn't load the config and it looks like stock tmux. I know that's not very helpful but that's what's happening for some reason.

gpakosz commented 7 years ago

Can you give the github-89 branch a try please?

aidanharris commented 7 years ago

@gpakosz Still not working. Doesn't seem to be any errors printed either.

gpakosz commented 7 years ago

What does cut -c3- ~/tmux.conf | sh -s _apply_bindings tell?

gpakosz commented 7 years ago

Also what's in your ~/.tmux.conf.local please?

gpakosz commented 7 years ago

(for the record, tmux 2.5 + fish shell + this conf works for me on Archlinux btw)

aidanharris commented 7 years ago

@gpakosz The ~/.tmux.conf.local is the same as the repo's. In the past I'd customised it slightly but for the purposes of troubleshooting you can assume that my config is exactly the same as the configs in this repo.

❯ cut -c3- ~/.tmux.conf | sh -s _apply_bindings
sed: -e expression #1, char 65: unknown option to `s'
gpakosz commented 7 years ago

And cut -c3- ~/tmux.conf | sh -xs _apply_bindings ?(it's going to be way more verbose)

aidanharris commented 7 years ago
+ cat
+ set -e
+ __newline='
'
+ _apply_bindings
++ tmux list-keys
++ grep new-window
++ head -1
+ line='bind-key    -T prefix       c                 new-window'
+ prefix='bind-key    -T prefix       c                 '
+ column=46
+ tmux_conf_new_window_retain_current_path=false
++ tmux list-keys
++ grep -e 'new-window\(\s\+-c\s\+"#{pane_current_path}\|$\)'
+ IFS=
+ read -r line
+ '[' -z 'bind-key    -T prefix       c                 new-window' ']'
++ echo 'bind-key    -T prefix       c                 new-window'
++ cut -c-46
++ sed -E -e 's/[^ \ta-zA-Z0-9,._+@%/-]/\\&/g'
+ left='bind-key    -T prefix       c                 '
+ _is_enabled false
+ '[' xfalse = xenabled ']'
+ '[' xfalse = xtrue ']'
+ '[' xfalse = xyes ']'
+ '[' xfalse = x1 ']'
+ return 1
++ echo 'bind-key    -T prefix       c                 new-window'
++ cut -c46-
++ awk '-F\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }'
++ sed -E -e 's/-c[ \t]+"#\{pane_current_path\}"$//g'
+ right=' new-window'
+ eval 'tmux bind-key    -T prefix       c                   new-window'
+ true
+ IFS=
+ read -r line
+ tmux_conf_new_pane_retain_current_path=true
++ tmux list-keys
++ grep -e 'split\(-\|_\)window'
+ IFS=
+ read -r line
+ '[' -z 'bind-key    -T prefix       "                 split-window -c "#{pane_current_path}"' ']'
++ echo 'bind-key    -T prefix       "                 split-window -c "#{pane_current_path}"'
++ cut -c-46
++ sed -E -e 's/[^ \ta-zA-Z0-9,._+@%/-]/\\&/g'
+ left='bind-key    -T prefix       \"                 '
+ _is_enabled true
+ '[' xtrue = xenabled ']'
+ '[' xtrue = xtrue ']'
+ return 0
++ echo 'bind-key    -T prefix       "                 split-window -c "#{pane_current_path}"'
++ cut -c46-
++ awk '-F\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }'
++ sed -E -e 's/split-window([ \t]+-(h|v))?$/& -c "#{pane_current_path}"/g'
+ right=' split-window -c "#{pane_current_path}"'
+ eval 'tmux bind-key    -T prefix       \"                   split-window -c "#{pane_current_path}"'
+ true
+ IFS=
+ read -r line
+ '[' -z 'bind-key    -T prefix       %                 split-window -h -c "#{pane_current_path}"' ']'
++ echo 'bind-key    -T prefix       %                 split-window -h -c "#{pane_current_path}"'
++ cut -c-46
++ sed -E -e 's/[^ \ta-zA-Z0-9,._+@%/-]/\\&/g'
+ left='bind-key    -T prefix       %                 '
+ _is_enabled true
+ '[' xtrue = xenabled ']'
+ '[' xtrue = xtrue ']'
+ return 0
++ echo 'bind-key    -T prefix       %                 split-window -h -c "#{pane_current_path}"'
++ cut -c46-
++ awk '-F\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }'
++ sed -E -e 's/split-window([ \t]+-(h|v))?$/& -c "#{pane_current_path}"/g'
+ right=' split-window -h -c "#{pane_current_path}"'
+ eval 'tmux bind-key    -T prefix       %                   split-window -h -c "#{pane_current_path}"'
+ true
+ IFS=
+ read -r line
+ '[' -z 'bind-key    -T prefix       -                 split-window -v -c "#{pane_current_path}"' ']'
++ echo 'bind-key    -T prefix       -                 split-window -v -c "#{pane_current_path}"'
++ cut -c-46
++ sed -E -e 's/[^ \ta-zA-Z0-9,._+@%/-]/\\&/g'
+ left='bind-key    -T prefix       -                 '
+ _is_enabled true
+ '[' xtrue = xenabled ']'
+ '[' xtrue = xtrue ']'
+ return 0
++ echo 'bind-key    -T prefix       -                 split-window -v -c "#{pane_current_path}"'
++ cut -c46-
++ awk '-F\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }'
++ sed -E -e 's/split-window([ \t]+-(h|v))?$/& -c "#{pane_current_path}"/g'
+ right=' split-window -v -c "#{pane_current_path}"'
+ eval 'tmux bind-key    -T prefix       -                   split-window -v -c "#{pane_current_path}"'
+ true
+ IFS=
+ read -r line
+ '[' -z 'bind-key    -T prefix       _                 split-window -h -c "#{pane_current_path}"' ']'
++ echo 'bind-key    -T prefix       _                 split-window -h -c "#{pane_current_path}"'
++ cut -c-46
++ sed -E -e 's/[^ \ta-zA-Z0-9,._+@%/-]/\\&/g'
+ left='bind-key    -T prefix       _                 '
+ _is_enabled true
+ '[' xtrue = xenabled ']'
+ '[' xtrue = xtrue ']'
+ return 0
++ echo 'bind-key    -T prefix       _                 split-window -h -c "#{pane_current_path}"'
++ cut -c46-
++ awk '-F\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }'
++ sed -E -e 's/split-window([ \t]+-(h|v))?$/& -c "#{pane_current_path}"/g'
+ right=' split-window -h -c "#{pane_current_path}"'
+ eval 'tmux bind-key    -T prefix       _                   split-window -h -c "#{pane_current_path}"'
+ true
+ IFS=
+ read -r line
+ tmux_conf_new_pane_reconnect_ssh=false
++ tmux list-keys
++ grep -e 'split\(-\|_\)window'
+ IFS=
+ read -r line
+ '[' -z 'bind-key    -T prefix       "                 split-window -c "#{pane_current_path}"' ']'
++ echo 'bind-key    -T prefix       "                 split-window -c "#{pane_current_path}"'
++ cut -c-46
++ sed -E -e 's/[^ \ta-zA-Z0-9,._+@%/-]/\\&/g'
+ left='bind-key    -T prefix       \"                 '
+ _is_enabled false
+ '[' xfalse = xenabled ']'
+ '[' xfalse = xtrue ']'
+ '[' xfalse = xyes ']'
+ '[' xfalse = x1 ']'
+ return 1
++ echo 'bind-key    -T prefix       "                 split-window -c "#{pane_current_path}"'
++ cut -c46-
++ awk '-F\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }'
++ sed -E -e 's/run-shell "cut -c3- ~\/\.tmux\.conf \| sh -s _split_window #\{pane_tty\}([^;]+)"/split-window\1/g' -e 's/#\{.+\}/\"&\"/g'
+ right=' split-window -c ""#{pane_current_path}""'
+ eval 'tmux bind-key    -T prefix       \"                   split-window -c ""#{pane_current_path}""'
+ true
+ IFS=
+ read -r line
+ '[' -z 'bind-key    -T prefix       %                 split-window -h -c "#{pane_current_path}"' ']'
++ echo 'bind-key    -T prefix       %                 split-window -h -c "#{pane_current_path}"'
++ cut -c-46
++ sed -E -e 's/[^ \ta-zA-Z0-9,._+@%/-]/\\&/g'
+ left='bind-key    -T prefix       %                 '
+ _is_enabled false
+ '[' xfalse = xenabled ']'
+ '[' xfalse = xtrue ']'
+ '[' xfalse = xyes ']'
+ '[' xfalse = x1 ']'
+ return 1
++ echo 'bind-key    -T prefix       %                 split-window -h -c "#{pane_current_path}"'
++ cut -c46-
++ awk '-F\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }'
++ sed -E -e 's/run-shell "cut -c3- ~\/\.tmux\.conf \| sh -s _split_window #\{pane_tty\}([^;]+)"/split-window\1/g' -e 's/#\{.+\}/\"&\"/g'
+ right=' split-window -h -c ""#{pane_current_path}""'
+ eval 'tmux bind-key    -T prefix       %                   split-window -h -c ""#{pane_current_path}""'
+ true
+ IFS=
+ read -r line
+ '[' -z 'bind-key    -T prefix       -                 split-window -v -c "#{pane_current_path}"' ']'
++ echo 'bind-key    -T prefix       -                 split-window -v -c "#{pane_current_path}"'
++ cut -c-46
++ sed -E -e 's/[^ \ta-zA-Z0-9,._+@%/-]/\\&/g'
+ left='bind-key    -T prefix       -                 '
+ _is_enabled false
+ '[' xfalse = xenabled ']'
+ '[' xfalse = xtrue ']'
+ '[' xfalse = xyes ']'
+ '[' xfalse = x1 ']'
+ return 1
++ echo 'bind-key    -T prefix       -                 split-window -v -c "#{pane_current_path}"'
++ cut -c46-
++ awk '-F\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }'
++ sed -E -e 's/run-shell "cut -c3- ~\/\.tmux\.conf \| sh -s _split_window #\{pane_tty\}([^;]+)"/split-window\1/g' -e 's/#\{.+\}/\"&\"/g'
+ right=' split-window -v -c ""#{pane_current_path}""'
+ eval 'tmux bind-key    -T prefix       -                   split-window -v -c ""#{pane_current_path}""'
+ true
+ IFS=
+ read -r line
+ '[' -z 'bind-key    -T prefix       _                 split-window -h -c "#{pane_current_path}"' ']'
++ echo 'bind-key    -T prefix       _                 split-window -h -c "#{pane_current_path}"'
++ cut -c-46
++ sed -E -e 's/[^ \ta-zA-Z0-9,._+@%/-]/\\&/g'
+ left='bind-key    -T prefix       _                 '
+ _is_enabled false
+ '[' xfalse = xenabled ']'
+ '[' xfalse = xtrue ']'
+ '[' xfalse = xyes ']'
+ '[' xfalse = x1 ']'
+ return 1
++ echo 'bind-key    -T prefix       _                 split-window -h -c "#{pane_current_path}"'
++ cut -c46-
++ awk '-F\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }'
++ sed -E -e 's/run-shell "cut -c3- ~\/\.tmux\.conf \| sh -s _split_window #\{pane_tty\}([^;]+)"/split-window\1/g' -e 's/#\{.+\}/\"&\"/g'
+ right=' split-window -h -c ""#{pane_current_path}""'
+ eval 'tmux bind-key    -T prefix       _                   split-window -h -c ""#{pane_current_path}""'
+ true
+ IFS=
+ read -r line
+ tmux_conf_new_session_prompt=false
++ tmux list-keys
++ grep -e new-session
+ IFS=
+ read -r line
+ '[' -z 'bind-key    -T prefix       C-c               new-session' ']'
++ echo 'bind-key    -T prefix       C-c               new-session'
++ cut -c-46
++ sed -E -e 's/[^ \ta-zA-Z0-9,._+@%/-]/\\&/g'
+ left='bind-key    -T prefix       C-c               '
+ _is_enabled false
+ '[' xfalse = xenabled ']'
+ '[' xfalse = xtrue ']'
+ '[' xfalse = xyes ']'
+ '[' xfalse = x1 ']'
+ return 1
++ echo 'bind-key    -T prefix       C-c               new-session'
++ cut -c46-
++ awk '-F\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }'
++ sed -E -e 's/command-prompt -p new-session[^;]+/new-session/g'
+ right=' new-session'
+ eval 'tmux bind-key    -T prefix       C-c                 new-session'
+ true
+ IFS=
+ read -r line
+ tmux_conf_copy_to_os_clipboard=false
+ command -v pbcopy
+ command -v reattach-to-user-namespace
+ command -v xsel
+ command -v xsel
+ command -v xclip
+ command='xclip -i -selection clipboard > /dev/null 2>&1'
+ command -v clip.exe
+ '[' -c /dev/clipboard ']'
+ for table in "" "-t emacs-copy" "-t vi-copy"
++ tmux list-keys
++ grep -e 'copy-selection\|copy-pipe'
++ head -1
+ line='bind-key    -T copy-mode    C-w               send-keys -X copy-selection-and-cancel'
+ prefix='bind-key    -T copy-mode    C-w               send-keys -X '
+ column=59
+ '[' -z 'bind-key    -T copy-mode    C-w               send-keys -X copy-selection-and-cancel' ']'
++ tmux list-keys
++ grep -e 'copy-selection\|copy-pipe'
+ IFS=
+ read -r line
+ '[' -z 'bind-key    -T copy-mode    C-w               send-keys -X copy-selection-and-cancel' ']'
++ echo 'bind-key    -T copy-mode    C-w               send-keys -X copy-selection-and-cancel'
++ cut -c-59
++ sed -E -e 's/[^ \ta-zA-Z0-9,._+@%/-]/\\&/g'
+ left='bind-key    -T copy-mode    C-w               send-keys -X '
+ _is_enabled false
+ '[' xfalse = xenabled ']'
+ '[' xfalse = xtrue ']'
+ '[' xfalse = xyes ']'
+ '[' xfalse = x1 ']'
+ return 1
++ echo 'bind-key    -T copy-mode    C-w               send-keys -X copy-selection-and-cancel'
++ cut -c59-
++ awk '-F\"' 'BEGIN { OFS = FS } { for (i = 1; i <= NF; i+=2) { gsub(/#{.+}/, "\"&\"", $i) } print }'
++ sed -E -e 's/copy-pipe(-and-cancel)? "xclip -i -selection clipboard > /dev/null 2>&1"$/copy-selection\1/g'
sed: -e expression #1, char 65: unknown option to `s'
+ right=
gpakosz commented 7 years ago

And I bet installing xsel unbreaks it!

aidanharris commented 7 years ago

@gpakosz Yep, that was it! Might want to add that to the README along with any other needed dependencies.

gpakosz commented 7 years ago

Well, now can you please uninstall xsel and try github-89 again to which I pushed more?

gpakosz commented 7 years ago

(if not please pull again)