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

Chinese characters copied to clipboard via VSCode test runner are corrupted #3727

Open
Fierygit opened this issue Mar 20, 2025 · 2 comments
Open
Labels
WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@Fierygit
Copy link

What version of Go, VS Code & VS Code Go extension are you using?

Version Information

$ go version
go version go1.24.1 darwin/arm64

Version: 1.98.2 (Universal)
Commit: ddc367ed5c8936efe395cffeec279b04ffd7db78
Date: 2025-03-12T13:32:45.399Z (1 wk ago)
Electron: 34.2.0
ElectronBuildId: 11161602
Chromium: 132.0.6834.196
Node.js: 20.18.2
V8: 13.2.152.36-electron.0
OS: Darwin arm64 23.6.0

Tools Configuration

Environment

GOBIN: undefined
toolsGopath:
gopath: /Users/firefly/go
GOROOT: /usr/local/go

Tools

go:	/usr/local/go/bin/go: go version go1.24.1 darwin/arm64

gopls:	/Users/firefly/go/bin/gopls	(version: v0.18.1 built with go: go1.24.1)
gotests:	/Users/firefly/go/bin/gotests	(version: v1.6.0 built with go: go1.24.1)
gomodifytags:	/Users/firefly/go/bin/gomodifytags	(version: v1.17.0 built with go: go1.24.1)
impl:	/Users/firefly/go/bin/impl	(version: v1.4.0 built with go: go1.24.1)
goplay:	/Users/firefly/go/bin/goplay	(version: v1.0.0 built with go: go1.24.1)
dlv:	/Users/firefly/go/bin/dlv	(version: v1.24.1 built with go: go1.24.1)

Share the Go related settings you have added/edited

i added nothing to the settings

Describe the bug

When running a Go test in VSCode using the ​**"Run Test"** button, Chinese characters copied to the clipboard are corrupted. However, when running the same test via the terminal using go test, the clipboard content is correct.

Steps to Reproduce

​Code Example:

func TestClipboard(t *testing.T) {
if err := clipboard.WriteAll("中文"); err != nil {
t.Fatal(err)
}
}

​Run in VSCode:
Open the Go file containing the above code.
Click the ​**"Run Test"** button from the GO Extension to execute the test.
​Run in Terminal:
go test -v -run TestClipboard

Expected Result

Regardless of whether the test is run in VSCode or the terminal, the clipboard content should be: 中文

Actual Result

​Run in VSCode:
Clipboard content is: 中文

​Run in Terminal:
Clipboard content is correct: 中文

@gopherbot gopherbot added this to the Untriaged milestone Mar 20, 2025
@jba
Copy link

jba commented Mar 20, 2025

Can you explain how to reproduce?

@firelizzard18
Copy link
Contributor

Whether you're using the test explorer (e.g. Image) or the legacy test support (e.g. Image) is likely relevant.

@h9jiang h9jiang added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Mar 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

5 participants