diff options
| author | Aiden Cline <[email protected]> | 2025-07-27 12:21:31 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-07-27 12:21:31 -0500 |
| commit | b18b646f8e50bb0d11bc57d424c3c1920ddaa657 (patch) | |
| tree | 79f14f9c870212a4573f352fd51ede4f1c993513 /packages/tui | |
| parent | 9741a6703cbd1abd4ff292b8d254e6b9100d2a2d (diff) | |
| download | opencode-b18b646f8e50bb0d11bc57d424c3c1920ddaa657.tar.gz opencode-b18b646f8e50bb0d11bc57d424c3c1920ddaa657.zip | |
fix: attachment bugs (#1335)
Diffstat (limited to 'packages/tui')
| -rw-r--r-- | packages/tui/internal/components/chat/editor.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/packages/tui/internal/components/chat/editor.go b/packages/tui/internal/components/chat/editor.go index 4311a4ca7..009a7ab6c 100644 --- a/packages/tui/internal/components/chat/editor.go +++ b/packages/tui/internal/components/chat/editor.go @@ -4,7 +4,6 @@ import ( "encoding/base64" "fmt" "log/slog" - "net/url" "os" "path/filepath" "strconv" @@ -732,7 +731,7 @@ func (m *editorComponent) createAttachmentFromFile(filePath string) *attachment. ID: uuid.NewString(), Type: "file", Display: "@" + filePath, - URL: fmt.Sprintf("file://./%s", filePath), + URL: fmt.Sprintf("file://%s", absolutePath), Filename: filePath, MediaType: mediaType, Source: &attachment.FileSource{ @@ -783,7 +782,7 @@ func (m *editorComponent) createAttachmentFromPath(filePath string) *attachment. ID: uuid.NewString(), Type: "file", Display: "@" + filePath, - URL: fmt.Sprintf("file://./%s", url.PathEscape(filePath)), + URL: fmt.Sprintf("file://%s", absolutePath), Filename: filePath, MediaType: mediaType, Source: &attachment.FileSource{ |
