Skip to content

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

Open
@jbranchaud

Description

@jbranchaud

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>.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions