summaryrefslogtreecommitdiffhomepage
path: root/packages/tui/internal/components/chat/editor.go
diff options
context:
space:
mode:
Diffstat (limited to 'packages/tui/internal/components/chat/editor.go')
-rw-r--r--packages/tui/internal/components/chat/editor.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/tui/internal/components/chat/editor.go b/packages/tui/internal/components/chat/editor.go
index 3bf11b231..2ed2a9079 100644
--- a/packages/tui/internal/components/chat/editor.go
+++ b/packages/tui/internal/components/chat/editor.go
@@ -4,6 +4,7 @@ import (
"encoding/base64"
"fmt"
"log/slog"
+ "net/url"
"os"
"path/filepath"
"strconv"
@@ -180,7 +181,7 @@ func (m *editorComponent) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
attachment := &textarea.Attachment{
ID: uuid.NewString(),
Display: "@" + filePath,
- URL: fmt.Sprintf("file://./%s", filePath),
+ URL: fmt.Sprintf("file://./%s", url.PathEscape(filePath)),
Filename: filePath,
MediaType: mediaType,
}