on main help sign in
Merge branch 'main' into ui
commit1ff0a532e6e6e01ba3d8ac67dd59732e2cba0ae8 authorAyman Bagabas <ayman.bagabas@gmail.com> dateWed 21 Jan 2026, 15:17 (9 months ago) parent7c21b1f4086e2f
2 files changed+5−3
internal/shell/shell.go+1−1 internal/tui/components/chat/editor/editor.go+4−2
internal/shell/shell.go+1−1
@@ -227,7 +227,7 @@ func (s *Shell) blockHandler() func(next interp.ExecHandlerFunc) interp.ExecHand
227227
228228 for _, blockFunc := range s.blockFuncs {
229229 if blockFunc(args) {
230− return fmt.Errorf("command is not allowed for security reasons: %s", strings.Join(args, " "))
230+ return fmt.Errorf("command is not allowed for security reasons: %q", args[0])
231231 }
232232 }
233233
internal/tui/components/chat/editor/editor.go+4−2
@@ -39,6 +39,9 @@ var (
3939 errClipboardUnknownFormat = fmt.Errorf("unknown clipboard format")
4040)
4141
42+// If pasted text has more than 10 newlines, treat it as a file attachment.
43+const pasteLinesThreshold = 10
44+
4245type Editor interface {
4346 util.Model
4447 layout.Sizeable
@@ -239,8 +242,7 @@ func (m *editorCmp) Update(msg tea.Msg) (util.Model, tea.Cmd) {
239242 m.textarea.SetValue(msg.Text)
240243 m.textarea.MoveToEnd()
241244 case tea.PasteMsg:
242− // If pasted text has more than 2 newlines, treat it as a file attachment.
243− if strings.Count(msg.Content, "\n") > 2 {
245+ if strings.Count(msg.Content, "\n") > pasteLinesThreshold {
244246 content := []byte(msg.Content)
245247 if len(content) > maxAttachmentSize {
246248 return m, util.ReportWarn("Paste is too big (>5mb)")