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

What's this tmux copy/paste interop for? #97

Open
jbranchaud opened this issue Dec 24, 2020 · 0 comments
Open

What's this tmux copy/paste interop for? #97

jbranchaud opened this issue Dec 24, 2020 · 0 comments

Comments

@jbranchaud
Copy link
Contributor

jbranchaud commented Dec 24, 2020

I've been digging through the .tmux.conf file recently. There are a couple lines designated as copy/paste interop:

# Copy/paste interop
bind C-c run "tmux show-buffer | reattach-to-user-namespace pbcopy"
bind C-v run "reattach-to-user-namespace pbpaste | tmux load-buffer - && tmux paste-buffer"

A couple things about this:

  1. This is apparently binding Ctrl-c to run a command to copy to the Mac OSX system buffer. That's in conflict with the system's use of Ctrl-c, which is to send a SIGINT to the current application. Is this intended? Or should it instead use the meta key (i.e. Cmd) -- M-c? Update: I was forgetting that the <prefix> comes first, so this would be triggered with Ctrl-z Ctrl-c.
  2. Versions of tmux 2.6+ shouldn't need to do the reattach-to-user-namespace thing anymore (source). I think that wrapper can be removed. Is there a need to support versions of tmux older than 2.6? If there is, we can add if-shell checks to only do the reattach for older versions so that reattach-to-user-namespace is not a dependency.
  3. I tried commenting out these lines altogether to see what functionality they might be account for. I then held option while making a mouse selection, hit Cmd-c, then hit Cmd-v. It copy-pasted my selection as expected. So, are these lines even needed or is this just a vestige of terminals of yore? Update: Same mistake as above with the missing <prefix>.
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

1 participant