Chinese characters copied to clipboard via VSCode test runner are corrupted #3727
Labels
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
Milestone
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
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: 中文
The text was updated successfully, but these errors were encountered: