MCPcopy Index your code
hub / github.com/coder/agentapi / redrawTerminal

Function redrawTerminal

e2e/echo.go:154–171  ·  view source on GitHub ↗
(messages []st.ConversationMessage, thinking bool)

Source from the content-addressed store, hash-verified

152}
153
154func redrawTerminal(messages []st.ConversationMessage, thinking bool) {
155 fmt.Print("\033[2J\033[H") // Clear screen and move cursor to home
156
157 // Show conversation history
158 for _, msg := range messages {
159 if msg.Role == st.ConversationRoleUser {
160 fmt.Printf("> %s\n", msg.Message)
161 } else {
162 fmt.Printf("%s\n", msg.Message)
163 }
164 }
165
166 if thinking {
167 fmt.Print("Thinking... ")
168 } else {
169 fmt.Print("> ")
170 }
171}
172
173func cleanTerminalInput(input string) string {
174 // Strip ANSI escape sequences

Callers 1

runEchoAgentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected