From 8b2a909e1f29b7c024d70b6eb5da7d73e9307941 Mon Sep 17 00:00:00 2001 From: Aiden Cline <63023139+rekram1-node@users.noreply.github.com> Date: Thu, 10 Jul 2025 11:19:54 -0500 Subject: fix: encode & decode file paths (#843) --- packages/tui/internal/components/chat/editor.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'packages/tui/internal') 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, } -- cgit v1.2.3