opencode: [0.2.6] pasting with ctrl+v crashes the program.
Version: 0.2.6 Terminal emulator: alacritty Running with tmux: yes window manager: awesomewm with xorg
Steps to reproduce:
- copy some string
- run opencode
- press ctrl+v
this will crash the program with the following output:
Caught panic:
clipboard: cannot use when CGO_ENABLED=0
Restoring terminal...
goroutine 1 [running]:
runtime/debug.Stack()
/opt/hostedtoolcache/go/1.24.4/x64/src/runtime/debug/stack.go:26 +0x5e
runtime/debug.PrintStack()
/opt/hostedtoolcache/go/1.24.4/x64/src/runtime/debug/stack.go:18 +0x13
github.com/charmbracelet/bubbletea/v2.(*Program).recoverFromPanic(0xc0004ce200, {0xbd99e0, 0x106b3a0})
/home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea/v2@v2.0.0-beta.3/tea.go:1134 +0xc5
github.com/charmbracelet/bubbletea/v2.(*Program).Run.func2()
/home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea/v2@v2.0.0-beta.3/tea.go:871 +0xe8
panic({0xbd99e0?, 0x106b3a0?})
/opt/hostedtoolcache/go/1.24.4/x64/src/runtime/panic.go:792 +0x132
golang.design/x/clipboard.read(...)
/home/runner/go/pkg/mod/golang.design/x/clipboard@v0.7.1/clipboard_nocgo.go:12
golang.design/x/clipboard.Read(0x0?)
/home/runner/go/pkg/mod/golang.design/x/clipboard@v0.7.1/clipboard.go:119 +0x85
github.com/sst/opencode/internal/components/chat.(*editorComponent).Paste(0xc000b22008)
/home/runner/work/opencode/opencode/packages/tui/internal/components/chat/editor.go:332 +0x37
github.com/sst/opencode/internal/tui.appModel.executeCommand({0xbe, 0x33, 0xc000b08288, {0x0, 0x0}, {0x7a4407a39578, 0xc00050feb0}, {0x10793c8, 0xc000b22008}, {0x1079340, ...}, ...}, ...)
/home/runner/work/opencode/opencode/packages/tui/internal/tui/tui.go:908 +0x7c9
github.com/sst/opencode/internal/tui.appModel.Update({0xbe, 0x33, 0xc000b08288, {0x0, 0x0}, {0x7a4407a39578, 0xc00050feb0}, {0x10793c8, 0xc000b22008}, {0x1079340, ...}, ...}, ...)
/home/runner/work/opencode/opencode/packages/tui/internal/tui/tui.go:344 +0x2ac5
github.com/charmbracelet/bubbletea/v2.(*Program).eventLoop(0xc0004ce200, {0x1070c18?, 0xc000b0d508?}, 0xc0000e81c0)
/home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea/v2@v2.0.0-beta.3/tea.go:767 +0x16e6
github.com/charmbracelet/bubbletea/v2.(*Program).Run(0xc0004ce200)
/home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea/v2@v2.0.0-beta.3/tea.go:1022 +0xe76
main.main()
/home/runner/work/opencode/opencode/packages/tui/cmd/opencode/main.go:106 +0xa98
Running with CGO_ENABLED=1 opencode doesn’t change the output.
pasting with ctrl+shift+v fixes the issue
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 1
- Comments: 23
my bad, i thought it was only an issue on darwin, will fix for linux as well, might be early AM tomorrow, apologies!
i’m working on this now, sorry
My setup is still crashing since 0.2.6 (using 0.2.13 now). My setup:
Main OS:
Windows 11 Pro 10.0.26100 Build 26100WSL OS:Ubuntu 24.04.2 LTS (GNU/Linux 5.15.153.1-microsoft-standard-WSL2 x86_64)Ghosty:ghostty version=1.1.3Workaround: Use something other than Ghostty (e.g., Windows Terminal).Ghostty started crashing on 0.2.6 as 0.2.5 is working. Stacktrace for 0.2.6:
v0.2.12 Stacktrace
v0.2.13 Stacktrace
all of these issues should be resolved in https://github.com/sst/opencode/releases/tag/v0.2.9
can you guys give this a test and lmk?