Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

How to only use OSC 52 clipboard for copy only? #28009

Closed
doums opened this issue Mar 24, 2024 · 0 comments
Closed

How to only use OSC 52 clipboard for copy only? #28009

doums opened this issue Mar 24, 2024 · 0 comments

Comments

@doums
Copy link

doums commented Mar 24, 2024

Problem

With terminals I use (wezterm/alacritty) the new osc52 clipboard feature works as expected for copy but not for paste operation.
For instance wezterm does not seem to allow reading the clipboard wez/wezterm/issues/2050

When I try to paste eg pressing p nvim become unresponsive, freeze during ~10seconds with the following message "Waiting for OSC 52 response from the terminal. Press Ctrl-C to interrupt…".
Finally, after this 10s timeouts or pressing ctrlC, the previously yanked text is pasted.

There is a way to set g.clipboard to enable osc52 for copy only, and keep whatever is nvim's default for paste?

I tried this but it's not working, I lose the osc52 feature

-- this is not working
vim.g.clipboard = {
  name = 'OSC 52',
  copy = {
    ['+'] = require('vim.ui.clipboard.osc52').copy('+'),
    ['*'] = require('vim.ui.clipboard.osc52').copy('*'),
  },
  paste = nil // do not override it, use nvim's default
}

Steps to reproduce

  1. start nvim with nvim --clean -u mini.lua
vim.o.clipboard = 'unnamedplus'

vim.g.clipboard = {
  name = 'OSC 52',
  copy = {
    ['+'] = require('vim.ui.clipboard.osc52').copy('+'),
    ['*'] = require('vim.ui.clipboard.osc52').copy('*'),
  },
  paste = {
    ['+'] = require('vim.ui.clipboard.osc52').paste('+'),
    ['*'] = require('vim.ui.clipboard.osc52').paste('*'),
  },
}
  1. yank some text eg. y then paste p

Expected behavior

Should past the yanked text instant and do not freeze 10s with "Waiting for OSC 52 response from the terminal. Press Ctrl-C to interrupt..." message

Neovim version (nvim -v)

NVIM v0.10.0-dev-2682+g011585f35f RelWithDebInfo LuaJIT 2.1.1702233742

Vim (not Nvim) behaves the same?

Operating system/version

archlinux 6.8.1-arch1-1

Terminal name/version

  • wezterm 20240203-110809-5046fc22
  • alacritty 0.13.1 (fe2a3c56)

Installation

aur neovim-git

@doums doums added the bug issues reporting wrong behavior label Mar 24, 2024
@neovim neovim locked and limited conversation to collaborators Mar 24, 2024
@clason clason converted this issue into discussion #28010 Mar 24, 2024
@zeertzjq zeertzjq removed the bug issues reporting wrong behavior label Mar 24, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants