Support for pasting images into context #376

Closed
opened 2026-02-16 17:26:29 -05:00 by yindo · 5 comments
Owner

Originally created by @mattrobenolt on GitHub (Jun 28, 2025).

Originally assigned to: @adamdotdevin on GitHub.

Claude Code for example, supports pasting in an image from your clipboard with Ctrl+V. This is nice for pasting in screenshots when screenshot to clipboard, Cmd+Ctrl+Shift+4 on macOS for example, then paste into the agent.

Originally created by @mattrobenolt on GitHub (Jun 28, 2025). Originally assigned to: @adamdotdevin on GitHub. Claude Code for example, supports pasting in an image from your clipboard with Ctrl+V. This is nice for pasting in screenshots when screenshot to clipboard, Cmd+Ctrl+Shift+4 on macOS for example, then paste into the agent.
yindo closed this issue 2026-02-16 17:26:29 -05:00
Author
Owner

@thdxr commented on GitHub (Jun 30, 2025):

coming this week

@thdxr commented on GitHub (Jun 30, 2025): coming this week
Author
Owner

@mattrobenolt commented on GitHub (Jun 30, 2025):

I just noticed how incoherent my issue was. Oops. ❤️

@mattrobenolt commented on GitHub (Jun 30, 2025): I just noticed how incoherent my issue was. Oops. ❤️
Author
Owner

@leeweisern commented on GitHub (Jul 3, 2025):

when is this coming? the only reason I still open up claude code is the lack of image support

@leeweisern commented on GitHub (Jul 3, 2025): when is this coming? the only reason I still open up claude code is the lack of image support
Author
Owner

@adamdotdevin commented on GitHub (Jul 8, 2025):

available in https://github.com/sst/opencode/releases/tag/v0.2.6, feedback welcomed; can drag&drop or paste with ctrl+v

@adamdotdevin commented on GitHub (Jul 8, 2025): available in [https://github.com/sst/opencode/releases/tag/v0.2.6](https://github.com/sst/opencode/releases/tag/v0.2.6), feedback welcomed; can drag&drop or paste with ctrl+v
Author
Owner

@mattrobenolt commented on GitHub (Jul 8, 2025):

Almost. :)

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 +0x64
runtime/debug.PrintStack()
        /opt/hostedtoolcache/go/1.24.4/x64/src/runtime/debug/stack.go:18 +0x1c
github.com/charmbracelet/bubbletea/v2.(*Program).recoverFromPanic(0x14000472200, {0x100fb70c0, 0x1010bca40})
        /home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea/v2@v2.0.0-beta.3/tea.go:1134 +0xb0
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 +0xdc
panic({0x100fb70c0?, 0x1010bca40?})
        /opt/hostedtoolcache/go/1.24.4/x64/src/runtime/panic.go:792 +0x124
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 +0x9c
github.com/sst/opencode/internal/components/chat.(*editorComponent).Paste(0x14000abc008)
        /home/runner/work/opencode/opencode/packages/tui/internal/components/chat/editor.go:332 +0x38
github.com/sst/opencode/internal/tui.appModel.executeCommand({0x57, 0x1b, 0x1400069a288, {0x0, 0x0}, {0x128565538, 0x1400001ff20}, {0x1010ca648, 0x14000abc008}, {0x1010ca5c0, ...}, ...}, ...)
        /home/runner/work/opencode/opencode/packages/tui/internal/tui/tui.go:908 +0x7d8
github.com/sst/opencode/internal/tui.appModel.Update({0x57, 0x1b, 0x1400069a288, {0x0, 0x0}, {0x128565538, 0x1400001ff20}, {0x1010ca648, 0x14000abc008}, {0x1010ca5c0, ...}, ...}, ...)
        /home/runner/work/opencode/opencode/packages/tui/internal/tui/tui.go:344 +0x2754
github.com/charmbracelet/bubbletea/v2.(*Program).eventLoop(0x14000472200, {0x1010c2238?, 0x14000aa3508?}, 0x14000112460)
        /home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea/v2@v2.0.0-beta.3/tea.go:767 +0x13f0
github.com/charmbracelet/bubbletea/v2.(*Program).Run(0x14000472200)
        /home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea/v2@v2.0.0-beta.3/tea.go:1022 +0xb10
main.main()
        /home/runner/work/opencode/opencode/packages/tui/cmd/opencode/main.go:106 +0x8fc
@mattrobenolt commented on GitHub (Jul 8, 2025): Almost. :) ``` 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 +0x64 runtime/debug.PrintStack() /opt/hostedtoolcache/go/1.24.4/x64/src/runtime/debug/stack.go:18 +0x1c github.com/charmbracelet/bubbletea/v2.(*Program).recoverFromPanic(0x14000472200, {0x100fb70c0, 0x1010bca40}) /home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea/v2@v2.0.0-beta.3/tea.go:1134 +0xb0 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 +0xdc panic({0x100fb70c0?, 0x1010bca40?}) /opt/hostedtoolcache/go/1.24.4/x64/src/runtime/panic.go:792 +0x124 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 +0x9c github.com/sst/opencode/internal/components/chat.(*editorComponent).Paste(0x14000abc008) /home/runner/work/opencode/opencode/packages/tui/internal/components/chat/editor.go:332 +0x38 github.com/sst/opencode/internal/tui.appModel.executeCommand({0x57, 0x1b, 0x1400069a288, {0x0, 0x0}, {0x128565538, 0x1400001ff20}, {0x1010ca648, 0x14000abc008}, {0x1010ca5c0, ...}, ...}, ...) /home/runner/work/opencode/opencode/packages/tui/internal/tui/tui.go:908 +0x7d8 github.com/sst/opencode/internal/tui.appModel.Update({0x57, 0x1b, 0x1400069a288, {0x0, 0x0}, {0x128565538, 0x1400001ff20}, {0x1010ca648, 0x14000abc008}, {0x1010ca5c0, ...}, ...}, ...) /home/runner/work/opencode/opencode/packages/tui/internal/tui/tui.go:344 +0x2754 github.com/charmbracelet/bubbletea/v2.(*Program).eventLoop(0x14000472200, {0x1010c2238?, 0x14000aa3508?}, 0x14000112460) /home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea/v2@v2.0.0-beta.3/tea.go:767 +0x13f0 github.com/charmbracelet/bubbletea/v2.(*Program).Run(0x14000472200) /home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea/v2@v2.0.0-beta.3/tea.go:1022 +0xb10 main.main() /home/runner/work/opencode/opencode/packages/tui/cmd/opencode/main.go:106 +0x8fc ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#376