gpakosz/.tmux

Copy tmux to mac clipboard doesn't work

shahar-spormas opened this issue ยท 9 comments

Im using this .tmux.conf for a while on my rocky machine and now i moved to mac and the copy paste wont work.

From the mac to the tmux it will print ^[[200~<pasted_test>~,
But form tmux to mac it just wont work :(

I have reattach-to-user-namespace on my mac.

I tried to clone it to start fresh and now the mouse wont work.

it would be great if you will take a look at it.
thanks, shahar.

Hello @shahar-spormas ๐Ÿ‘‹

You don't need reattach-to-user-namespace on recent macOS. Maybe you could try to uninstall it first.

Then how do you paste exactly?

HEy @gpakosz ๐Ÿ˜ƒ

Im trying command + c after highlight, shift + cmd + c, opt + cmd +c and opt + left click
I uninstalled it and there is the same problem

Important note i added the mouse functionality and trying to copy from tmux out to the host (mac)

Hello @shahar-spormas,

Well in tmux there's no such thing as using โŒ˜+C for copying etc...
I suggest that you get familiar with the concept of tmux bindings, and tmux copy mode.

If you enabled mouse support with <prefix>+M, the default behavior is to copy when the drag ends. If you set tmux_conf_copy_to_os_clipboard to true in your .local customization file, then it's going to use pbcopy to copy into the general pasteboard.

See the output of tmux lsk | grep MouseDrag1 and tmux | grep -E 'copy-(pipe|selection)'

yeah "getting familliar with tmux binding"...
I know how to use tmux but im talking about the system.
i have now problem copy pasting in tmux itself to take it out of tmux thats my problem.

tmux_conf_copy_to_os_clipboard is true

tmux lsk | grep tmux lsk | grep MouseDrag1:
grep: lsk: Nosuch file or directory

tmux -L test lsk | grep -E 'copy-(pipe|selection):
shows me all binds related to copy (i cant copy it from the terminal..)

Hmm sorry I wrote erroneous commands above (see my edited comment).

Anyways, trying to sum it up

  • Oh my tmux! has bindings to copy to the os clipboard when tmux_conf_copy_to_os_clipboard=true
    • One way is to enable mouse mode with <prefix> + m and select some text
    • Another way is to enter copy mode, select text, then use the y key which will copy into both the tmux buffer and the os clipboard
  • There's no specific tmux binding to paste from the os clipboard, e.g. on macOS you jut use โŒ˜+V

Alternatively, (and this may help OP as well) is there a way to flat out disable the copy mode with mouse mode on? If I turn mouse mode off, scroll wheel scrolls commands rather than the window. With it on, my OS doesn't see highlighted text. I'd personally prefer to just let my OS handle copy/paste.

Bonus points if we can unbind mouse middle click too. <-- Scratch that, I'm dense. That's an OS problem for me personally and the way I'm doing things. I'll just rebind the mouse button OS side :-)

@gpakosz

When I enter copy mode it wont highlight that i want to copy.
I think thats the main problem ( I'm doing ctrl + ] and space to start coping )

I don't understand what's ctrl + ] is supposed to achieve.

Just to make sure things are clear:

  • Oh my tmux! with tmux_conf_copy_to_os_clipboard=true will copy to the OS clipboard when using the copy commands, on macOS see the output of tmux lsk | grep pbcopy to see all the bindings that will use pbcopy command.
  • There's no binding to paste from the OS clipboard, on macOS this is just achieved by using โŒ˜+V

Hello @shahar-spormas ๐Ÿ‘‹

Any news?