getMultilineInput obtém entrada de múltiplas linhas. Uses the centralized stdin reader when active.
(promptStr string)
| 295 | // getMultilineInput obtém entrada de múltiplas linhas. |
| 296 | // Uses the centralized stdin reader when active. |
| 297 | func (a *AgentMode) getMultilineInput(promptStr string) string { |
| 298 | fmt.Print(promptStr) |
| 299 | fmt.Println(i18n.T("agent.multiline_input_tip")) |
| 300 | |
| 301 | // Enable bracketed paste mode for paste detection |
| 302 | if runtime.GOOS != "windows" || os.Getenv("WT_SESSION") != "" { |
| 303 | _, _ = os.Stdout.WriteString("\x1b[?2004h") |
| 304 | defer func() { _, _ = os.Stdout.WriteString("\x1b[?2004l") }() |
| 305 | } |
| 306 | |
| 307 | var lines []string |
| 308 | for { |
| 309 | line := a.readLine() |
| 310 | if line == "." { |
| 311 | break |
| 312 | } |
| 313 | lines = append(lines, line) |
| 314 | } |
| 315 | |
| 316 | return strings.Join(lines, "\n") |
| 317 | } |
| 318 | |
| 319 | // handleCommandBlocks processa blocos de comandos com UI refinada |
| 320 | func (a *AgentMode) handleCommandBlocks(ctx context.Context, blocks []CommandBlock) { |
no test coverage detected