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

Copy tmux to mac clipboard doesn't work #694

Open
shahar-spormas opened this issue Dec 17, 2023 · 9 comments
Open

Copy tmux to mac clipboard doesn't work #694

shahar-spormas opened this issue Dec 17, 2023 · 9 comments

Comments

@shahar-spormas
Copy link

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.

@gpakosz
Copy link
Owner

gpakosz commented Dec 17, 2023

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?

@shahar-spormas
Copy link
Author

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)

@gpakosz
Copy link
Owner

gpakosz commented Dec 19, 2023

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)'

@shahar-spormas
Copy link
Author

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

@gpakosz
Copy link
Owner

gpakosz commented Dec 19, 2023

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

@joedulin
Copy link

joedulin commented Dec 19, 2023

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 :-)

@shahar-spormas
Copy link
Author

@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 )

@gpakosz
Copy link
Owner

gpakosz commented Dec 26, 2023

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

@gpakosz
Copy link
Owner

gpakosz commented Feb 2, 2024

Hello @shahar-spormas 👋

Any news?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants