Open Nezteb opened 1 year ago
I will need more time to be certain but i think I solved it with this config
keys = {
{
key = 'C',
mods = 'CMD',
action = wezterm.action.CopyTo 'ClipboardAndPrimarySelection',
},
},
I know iOS has per-app clipboards and clipboard security things now, so perhaps MacOS Sonoma had similar clipboard changes?
wezterm only uses the global pasteboard on macos, so the various clipboard destinations don't change any behavior in wezterm on macos.
FWIW, I never use CMD-C to copy in wezterm; the act of selecting the text automatically copies to the clipboard. I wonder if the issue is that trying to update the clipboard twice in quick succession (once from selecting the text, then again when pressing CMD-C) somehow causes this?
JFTR as a lurker: I have the problem that a freshly started WezTerm on macOS Sonoma on an M2 has select to copy work, but when I do OP's steps it stops working until I restart it.
I'm really curious/jealous that it works for you.
My config just in case – it 100% worked before Sonoma. :|
Can you confirm that this only happens when you try to CMD-C to copy? If you skip pressing CMD-C, does the selected text copy and paste successfully?
No, it does not. That's the reason why I've started pressing CMD-C in the first place. Is calling this behavior select to copy
correct? I've had a very hard time searching for other people having this problem, which is why I've sat on it since Sonoma came out. I can open another bug, but I find it weird, that my select to copy breaks for the same reasons CMD-C becomes flaky. To be explicit: I have both problems.
I'm not suggesting that you have a different problem, I'm just trying to understand why it might be happening; the macOS clipboard API is pretty simple and wezterm hasn't changed its use in a long time. For something to change when updating to Sonoma strongly implies that something on the system has changed. I'm also on Sonoma and haven't experienced this, which makes it extra curious.
Are you perhaps also running some kind of clipboard management software? If so, can you try disabling that for a while and see if it might be influencing things?
OK fun observation: my select to copy bug seems to be indeed the same one because now I've tried the obvious and selected the same thing multiple times and it copied! Not always just twice, mind you.
I run BetterTouchTool whose clipboard functionality I don't use and Alfred whose I do use. I've quit both but the behavior is the same.
More experimenting prompted me to quit PopClip too and it seems to repeatably make the problem go away (just excluding WezTerm works too)!
Which is weird, I've been using it since 2011 without problems. :|
I'm not suggesting that you have a different problem, I'm just trying to understand why it might be happening
And I'm just oversharing since I have your attention – sorry. :)
What Operating System(s) are you seeing this problem on?
macOS
WezTerm version
wezterm 20231029-184147-bc99181f
Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?
Yes, and I updated the version box above to show the version of the nightly that I tried
Describe the bug
Often when I am trying to copy text from WezTerm into another app, the copy fails and the clipboard isn't actually updated. I've only noticed this issue after upgrading to macOS 14.1 (Sonoma).
Toward the bottom of this GH issue I copy-pasted some information from the WezTerm Matrix chat room that has some more details.
Unfortunately, the issue is inconsistent and doesn't occur every time, but usually after trying a couple times I can get it to occur again.
Below is a video demo of the bug occurring. It's worth noting that I'm using Nushell, but the same bug happens when using
zsh
as well.https://github.com/wez/wezterm/assets/3588798/a52014e6-7524-48f6-b2fb-9bcaccdafad1
To Reproduce
CMD+C
once).Configuration
Expected Behavior
A single invocation of
CMD+C
should copy the selected text in WezTerm to the macOS clipboard.Logs
The most detailed log I can find has this content:
Anything else?
Relevant Matrix messages:
https://matrix.to/#/!PirwUBcuIlTXwNveYz:matrix.org/$GZAFbImUXvnOc_K8zObQgL6zEMnYqtVQTgWcoUPiz2A?via=matrix.org&via=kde.org&via=mozilla.org
https://matrix.to/#/!PirwUBcuIlTXwNveYz:matrix.org/$1uWszhJTT3e0ErePWsYBKynjUqHHvoNXyfHW6RZw4zg?via=matrix.org&via=kde.org&via=mozilla.org
(That last edit was me thinking the latest nightly had resolved the issue for me, but it turns out it did not, hence me creating this GH issue)