christoomey/dotfiles

vi-copy commands failing on tmux v2.3 / master

JESii opened this issue · 9 comments

JESii commented

Hi, Chris... great dotfiles; thanks.

I tried using your tmux config on the latest tmux (essentially V2.1) and all the vi-copy commands fail:

bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
unbind -t vi-copy Enter
bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
unbind -t vi-copy Space
bind -t vi-copy Space jump-again
bind-key -t vi-copy 0 back-to-indentation
bind -t vi-copy 'v' begin-selection
bind -t vi-copy 'y' copy-selection
bind -t vi-copy 'r' rectangle-toggle

Did I screw something else up, or are you on an earlier version of tmux?

Hey @JESii, nice to hear from you!

I'm running with the following config on tmux 2.3:

# Use vim keybindings in copy mode
setw -g mode-keys vi
bind-key -t vi-copy v begin-selection
bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
unbind -t vi-copy Enter
bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
unbind -t vi-copy Space
bind -t vi-copy Space jump-again
bind-key -t vi-copy 0 back-to-indentation
bind y run 'tmux save-buffer - | reattach-to-user-namespace pbcopy '
bind C-y run 'tmux save-buffer - | reattach-to-user-namespace pbcopy '

Not sure what the issue is with your config setup, but the above works for me. Is there a specific error message or failure mode you encounter?

JESii commented

You too, Chris... if/when you're out in San Francisco, give me a shout and we can grab a bite to eat.

When I'm back in the office tomorrow, I'll reset my config and try again (and of course, I should have given you the error messages... sorry)

JESii commented

Here are the errors I was getting:

 invalid or unknown command: bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
 invalid or unknown command: unbind -t vi-copy Enter
 invalid or unknown command: bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
 invalid or unknown command: unbind -t vi-copy Space
 invalid or unknown command: bind -t vi-copy Space jump-again
 invalid or unknown command: bind-key -t vi-copy 0 back-to-indentation
 invalid or unknown command: bind -t vi-copy 'v' begin-selection
 invalid or unknown command: bind -t vi-copy 'y' copy-selection
 invalid or unknown command: bind -t vi-copy 'r' rectangle-toggle

I'm gonna check my .conf file again and see if anything jumps out at me.

JESii commented

OK; I have these commands from your config:

### FROM Chris Toomey's config
setw -g mode-keys vi
bind-key -t vi-copy v begin-selection
bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
unbind -t vi-copy Enter
bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
unbind -t vi-copy Space
bind -t vi-copy Space jump-again
bind-key -t vi-copy 0 back-to-indentation
bind y run 'tmux save-buffer - | reattach-to-user-namespace pbcopy '
bind C-y run 'tmux save-buffer - | reattach-to-user-namespace pbcopy '
### END Chris Toomey's config

And I still get those errors... Am gonna try rebooting tmux and see if that makes a dofference (don't know why it should...)

JESii commented

Nope; didn't make any difference. Whenver I reload the .tmux.conf, I get those error messages

JESii commented

Hi, Chris... Sorry if I seemed to get a little too "familiar" with my lunch invitation. For some reason, I thought you remembered that I took your design class in Boston (2, maybe 3 years ago). Obviously, that was stretching things a bit so my apologies for expecting you to have the memory of an elephant :=)

Hi Jon, no worries and thanks for the invite! Always appreciated and welcome. I'm not sure if I remember crossing paths when you were here for the design class, but I certainly recognize from years on Upcase. Sorry I can't be of more help with the tmux issues :(

@JESii I started getting these errors recently after an update to tmux 2.4 on Arch linux. The way the bindings works changed a bit, see tmux issue #610 here for solution.

Closing this now as things are working fine for me, and I think other sources are a better starting point for folks having issues on newer tmux versions.