The open source coding agent.
TypeScript
fix: escape ansi sequences (#1139)
Aiden Cline97d9c851e672
diff --git a/packages/tui/go.mod b/packages/tui/go.modindex f2ad0c56c0f..e23e05c300f 100644--- a/packages/tui/go.mod+++ b/packages/tui/go.mod@@ -10,7 +10,6 @@ require (github.com/charmbracelet/glamour v0.10.0github.com/charmbracelet/lipgloss/v2 v2.0.0-beta.3github.com/charmbracelet/x/ansi v0.9.3- github.com/charmbracelet/x/input v0.3.7github.com/google/uuid v1.6.0github.com/lithammer/fuzzysearch v1.1.8github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6@@ -34,6 +33,7 @@ require (github.com/atombender/go-jsonschema v0.20.0 // indirectgithub.com/charmbracelet/lipgloss v1.1.1-0.20250404203927-76690c660834 // indirectgithub.com/charmbracelet/x/exp/slice v0.0.0-20250327172914-2fdc97757edf // indirect+ github.com/charmbracelet/x/input v0.3.7 // indirectgithub.com/charmbracelet/x/windows v0.2.1 // indirectgithub.com/dprotaso/go-yit v0.0.0-20220510233725-9ba8df137936 // indirectgithub.com/fsnotify/fsnotify v1.8.0 // indirectdiff --git a/packages/tui/internal/components/chat/message.go b/packages/tui/internal/components/chat/message.goindex ef097c09c5f..6199e9bf26e 100644--- a/packages/tui/internal/components/chat/message.go+++ b/packages/tui/internal/components/chat/message.go@@ -378,7 +378,8 @@ func renderToolDetails(stdout := metadata["stdout"]if stdout != nil {command := toolInputMap["command"].(string)- body = fmt.Sprintf("```console\n> %s\n%s```", command, stdout)+ out := ansi.Strip(fmt.Sprintf("%s", stdout))+ body = fmt.Sprintf("```console\n> %s\n%s```", command, out)body = util.ToMarkdown(body, width, backgroundColor)}case "webfetch":