diff --git a/internal/tui/components/chat/editor/editor.go b/internal/tui/components/chat/editor/editor.go index 4c7df84daad5b911be66dcd7f7cf6d832d714293..37327ae86243e3cd211c822da10a07133916d318 100644 --- a/internal/tui/components/chat/editor/editor.go +++ b/internal/tui/components/chat/editor/editor.go @@ -228,7 +228,7 @@ func (m *editorCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) { case tea.PasteMsg: path := strings.ReplaceAll(string(msg), "\\ ", " ") // try to get an image - path, err := filepath.Abs(path) + path, err := filepath.Abs(strings.TrimSpace(path)) if err != nil { m.textarea, cmd = m.textarea.Update(msg) return m, cmd