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

All the content of the neovim register is automatically copied to the system clipboard, and the number and Chinese display is garbled #762

Closed
2 tasks done
darkwilldie opened this issue May 24, 2023 · 8 comments
Labels
bug Something isn't working env Issues caused by incorrect environment settings (terminal, package manager, etc.) platform:windows

Comments

@darkwilldie
Copy link

Version confirmation

  • Confirm

Following prerequisites

  • Confirm

Neovim version

NVIM v0.10.0-dev

Operating system/version

wsl2

Terminal name/version

window terminal

$TERM environment variable

xterm-256color

Branch info

main (Default/Latest)

Fetch Preferences

SSH (use_ssh = true)

How to reproduce the issue

Everytime entering nvim, not only the command of "yy" will automatically connect to the system clipboard, but also "dd".The displayment of numbers can be
image
and Chinese characters can be
image

Expected behavior

I hope it can display properly.

Actual behavior

No response

Additional information

No response

@darkwilldie darkwilldie added the bug Something isn't working label May 24, 2023
@ayamir
Copy link
Owner

ayamir commented May 24, 2023

not only the command of "yy" will automatically connect to the system clipboard, but also "dd".

It's vim default behaviorl, not bug.

Because clip.exe can't recognize Chinese characters as UTF-8 string.

The better solution what I can think of is revert to use win32yank.exe.

What do you think? @CharlesChiuGit

@CharlesChiuGit
Copy link
Collaborator

CharlesChiuGit commented May 24, 2023

not only the command of "yy" will automatically connect to the system clipboard, but also "dd".

It's vim default behaviorl, not bug.

ys, vim will send things to register after dd, and then to clip.exe. if u want to change that, u can tune the clipboard settings, or learn how to delete things to "void" and not the register.


For the invalid characters part, I think it needs further investigation, cause the number shouldn't have UTF-8 encoding issues.

@darkwilldie can u try:

  1. use windows terminal and win32yank
  2. use wezterm and win32yank
  3. use wezterm and clip.exe
  4. check font settings in wsl and Windows

Also please make sure everything is up-to-date, including Windows updates and wsl updates, etc.

@CharlesChiuGit
Copy link
Collaborator

CharlesChiuGit commented May 24, 2023

I found a related issue.
microsoft/WSL#4852

@ayamir
Copy link
Owner

ayamir commented May 24, 2023

Temp work around for you @darkwilldie :

		vim.g.clipboard = {
			name = "win32yank-wsl",
			copy = {
				["+"] = "win32yank.exe -i --crlf",
				["*"] = "win32yank.exe -i --crlf",
			},
			paste = {
				["+"] = "win32yank.exe -o --lf",
				["*"] = "win32yank.exe -o --lf",
			},
			cache_enabled = 0,
		}

@darkwilldie
Copy link
Author

not only the command of "yy" will automatically connect to the system clipboard, but also "dd".

It's vim default behaviorl, not bug.

ys, vim will send things to register after dd, and then to clip.exe. if u want to change that, u can tune the clipboard settings, or learn how to delete things to "void" and not the register.

For the invalid characters part, I think it needs further investigation, cause the number shouldn't have UTF-8 encoding issues.

@darkwilldie can u try:

  1. use windows terminal and win32yank
  2. use wezterm and win32yank
  3. use wezterm and clip.exe
  4. check font settings in wsl and Windows

Also please make sure everything is up-to-date, including Windows updates and wsl updates, etc.

Replaced with Wezterm, the problem remains the same, so I believe this issue is unrelated to windows terminal
image
when using psyank, the mess remains(system clipboard is garbled but the registers of neovim display fine), while it solved by changing to wsl32yank(because any copied content won't be transferred to system clipboard)

@darkwilldie
Copy link
Author

I found a related issue. microsoft/WSL#4852

image

@darkwilldie
Copy link
Author

well, I reset Win32yank and now it works fine.

@ayamir
Copy link
Owner

ayamir commented May 25, 2023

750eef1

@ayamir ayamir closed this as completed May 25, 2023
@Jint-lzxy Jint-lzxy added platform:windows env Issues caused by incorrect environment settings (terminal, package manager, etc.) labels May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working env Issues caused by incorrect environment settings (terminal, package manager, etc.) platform:windows
Projects
None yet
Development

No branches or pull requests

4 participants