wezterm icon indicating copy to clipboard operation
wezterm copied to clipboard

CopyTo clipboard not always works in VirtualBox

Open damanis opened this issue 3 years ago • 4 comments

What Operating System(s) are you seeing this problem on?

Linux X11

Which Wayland compositor or X11 Window manager(s) are you using?

WindowMaker

WezTerm version

wezterm 20220823-223426-ad7199c1

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

After run wezterm first time copy mouse selection to clipboard (CopyTo("Clipboard")) works properly. Second selection seen in clipboard on guest machine, but host still see first selection. In rxvt-unicode and kitty all work as expected.

To Reproduce

VirtualBox with Ubuntu 20.04 (guest) on Windows laptop (host).

  • run wezterm
  • in wezterm select something (sel1) by mouse and press key to copy to clipboard
  • on Windows paste from clipboard - work properly
  • select another text (sel2) in wezterm and copy it to clipboard
  • on Windows paste from clipboard - still sel1 instead of sel2. On guest machine 'xsel -o -b' shows sel2 as expected.

Configuration

wezterm.lua only configure shortcuts.

Expected Behavior

Each selection copied to clipboard should be seen in host machine.

Logs

No response

Anything else?

No response

damanis avatar Aug 24 '22 07:08 damanis

If the selection has the correct values inside the VM and you're able to copy and paste between apps inside the VM then it sounds like an issue with the VM integration layer. If I were you, I would search for other similar sounding issues with virtualbox to see if that gives some clues on what to dig into next.

wez avatar Aug 24 '22 13:08 wez

@wez It seems, like VirtualBox problem and I find that what may be wrong. I opened the issue, because the problem exists only in WezTerm.

damanis avatar Aug 24 '22 14:08 damanis

I understand, but a VM is, by design, not visible to the programs that run inside. If the guest works correctly then there's something about the VM interaction causing the issue.

I don't use the environment that you are running in, and don't have the time to replicate the system of everyone that encounters problems: there is just one of me and I am massively outnumbered by wezterm users.

That means that it is up to you to dig into this more deeply to get more information about what is going wrong. I'd be happy to consider any additional information you can provide.

wez avatar Aug 24 '22 15:08 wez

I made workaround (like neovim works), may be it can help to understand the problem.

{key="w", mods="WIN", action=wezterm.action_callback(function(win, pane)
    local sel = win:get_selection_text_for_pane(pane)
    wezterm.background_child_process{"bash", "-c", "printf " .. sel .. "| xsel -b"}
    end)
},

damanis avatar Aug 28 '22 05:08 damanis

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

github-actions[bot] avatar May 01 '23 03:05 github-actions[bot]