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

tmate fails with tmux 2.4 key bindings #108

Closed
m1foley opened this issue May 10, 2017 · 9 comments
Closed

tmate fails with tmux 2.4 key bindings #108

m1foley opened this issue May 10, 2017 · 9 comments

Comments

@m1foley
Copy link

m1foley commented May 10, 2017

On MacOS I have installed tmux 2.4 (brew install tmux) and tmate 2.2.1 (brew install tmate).

tmate starts up with an error:

/Users/mike/.tmux.conf:2: usage: send-keys [-lRM] [-t target-pane] key ...

My .tmux.conf binds keys in tmux 2.4 format:

bind-key -T copy-mode-vi 'v' send -X begin-selection

How do you advise using tmate with tmux 2.4? Is the only solution to downgrade tmux back to 2.3 (brew switch tmux 2.3_3; brew pin tmux)?

@m1foley
Copy link
Author

m1foley commented May 11, 2017

Homebrew moving to tmux 2.4 is messing up the entire tmux ecosystem. I guess it's time tmate had its own issue similar to the ones the tmux plugins are seeing.

@nviennot
Copy link
Member

ahh!
This means that tmate must be upgraded to the 2.4 version.
Will do it soon.

@mjs2600
Copy link

mjs2600 commented May 31, 2017

I made a ~/.tmate.conf file, which works well for now. Is there any way to tell tmate not to source ~/.tmux.conf?

@nviennot
Copy link
Member

nviennot commented Jun 2, 2017

sadly no, maybe that should be an option.

@eschro-illumio
Copy link

tmate -f /dev/null loads defaults for me. (any non-existent file should work though)

@m1foley
Copy link
Author

m1foley commented Nov 20, 2017

As a workaround, I have this in ~/.tmux.conf. It works with tmux 2.6 and tmate 2.2.1.

# Enable copying to clipboard from vi mode. Remap C-j for pane switching later.
# tmate is a fork of tmux 2.4, so it needs old keybindings.
# TODO: when tmate finally upgrades its tmux, remove this and
# `brew uninstall reattach-to-user-namespace`.
if-shell "pstree -p $$ | grep [t]mate" \
  'unbind c; bind c new-window -c "#{pane_current_path}"; \
  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 C-j; '\
  'bind -T copy-mode-vi v send -X begin-selection; \
  bind -T copy-mode-vi V send -X select-line; \
  bind -T copy-mode-vi C-v send -X rectangle-toggle \; send -X begin-selection; \
  bind -T copy-mode-vi y send -X copy-pipe-and-cancel pbcopy; \
  bind -T copy-mode-vi Escape send -X cancel; \
  unbind -T copy-mode-vi C-j;'

@nviennot
Copy link
Member

Because tmate didn't catch up with tmux, maybe the best thing to do for tmate is to not load the tmux configuration file by default?

@hh
Copy link

hh commented Oct 21, 2019

I'm on board with that.

@0xO0O0
Copy link

0xO0O0 commented Jul 22, 2021

can we update now please !!

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

6 participants