MCPcopy Create free account
hub / github.com/diillson/chatcli / getInput

Method getInput

cli/agent_mode.go:599–616  ·  view source on GitHub ↗

getInput obtém entrada do usuário de forma segura. Uses the centralized stdin reader when active, falls back to direct read.

(promptStr string)

Source from the content-addressed store, hash-verified

597// getInput obtém entrada do usuário de forma segura.
598// Uses the centralized stdin reader when active, falls back to direct read.
599func (a *AgentMode) getInput(promptStr string) string {
600 if runtime.GOOS != "windows" {
601 cmd := exec.Command(sttyPath, "sane")
602 cmd.Stdin = os.Stdin
603 _ = cmd.Run()
604 }
605
606 // Enable bracketed paste mode for paste detection
607 if runtime.GOOS != "windows" || os.Getenv("WT_SESSION") != "" {
608 _, _ = os.Stdout.WriteString("\x1b[?2004h")
609 defer func() { _, _ = os.Stdout.WriteString("\x1b[?2004l") }()
610 }
611
612 fmt.Print(promptStr)
613
614 // Use centralized stdin reader (paste detection already handled there)
615 return a.readLine()
616}
617
618// clientAndCtxForTurn resolves the LLM client and context for a single ReAct
619// turn, honoring any skill model/effort hints captured at Run() start.

Callers 11

handleCommandBlocksMethod · 0.95
cmdViewOutputMethod · 0.95
cmdSaveOutputMethod · 0.95
cmdBatchExecuteMethod · 0.95
cmdEditAndExecuteMethod · 0.95
cmdAddContextContinueMethod · 0.95
cmdContinueMethod · 0.95
cmdPreContextMethod · 0.95
cmdExecuteSingleMethod · 0.95
editCommandBlockMethod · 0.95

Calls 2

readLineMethod · 0.95
RunMethod · 0.65

Tested by

no test coverage detected