diff --git a/core/cmd/dms/commands_chroma.go b/core/cmd/dms/commands_chroma.go index 7849c8a1..4945f33e 100644 --- a/core/cmd/dms/commands_chroma.go +++ b/core/cmd/dms/commands_chroma.go @@ -185,6 +185,12 @@ func runChroma(cmd *cobra.Command, args []string) { } source = string(content) } else { + stat, _ := os.Stdin.Stat() + if (stat.Mode() & os.ModeCharDevice) != 0 { + _ = cmd.Help() + os.Exit(0) + } + content, err := io.ReadAll(os.Stdin) if err != nil { fmt.Fprintf(os.Stderr, "Error reading stdin: %v\n", err)