formatPaste wraps message in bracketed paste escape sequences. These sequences start with ESC (\x1b), which TUI selection widgets (e.g. Claude Code's numbered-choice prompt) interpret as "cancel". For selection prompts, callers should use MessageTypeRaw to send raw keystrokes directly instead.
(message string)
| 11 | // as "cancel". For selection prompts, callers should use |
| 12 | // MessageTypeRaw to send raw keystrokes directly instead. |
| 13 | func formatPaste(message string) []st.MessagePart { |
| 14 | return []st.MessagePart{ |
| 15 | // Bracketed paste mode start sequence |
| 16 | st.MessagePartText{Content: "\x1b[200~", Hidden: true}, |
| 17 | st.MessagePartText{Content: message}, |
| 18 | // Bracketed paste mode end sequence |
| 19 | st.MessagePartText{Content: "\x1b[201~", Hidden: true}, |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | func formatClaudeCodeMessage(message string) []st.MessagePart { |
| 24 | parts := make([]st.MessagePart, 0) |
no outgoing calls
no test coverage detected