dify/dify-agent-runtime/cmd/sanitize-pty/main.go
Yunlu Wen 302d7b1e1b
feat(agent): shellctl rewritten in go (#38841)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-07-15 01:58:36 +00:00

23 lines
582 B
Go

// shellctl-sanitize-pty is a stdin→stdout PTY sanitizer used by tmux pipe-pane.
// It strips ANSI escape sequences, normalizes carriage-return progress lines,
// and performs incremental UTF-8 decoding.
package main
import (
"flag"
"fmt"
"os"
"github.com/langgenius/dify/dify-agent-runtime/internal/sanitize"
)
func main() {
readyFile := flag.String("ready-file", "", "path to touch before reading stdin")
flag.Parse()
if err := sanitize.Run(*readyFile, os.Stdin, os.Stdout); err != nil {
fmt.Fprintf(os.Stderr, "shellctl-sanitize-pty: %v\n", err)
os.Exit(1)
}
}