mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-24 13:32:50 -05:00
fix: dms chroma hang on print
This commit is contained in:
@@ -185,6 +185,12 @@ func runChroma(cmd *cobra.Command, args []string) {
|
|||||||
}
|
}
|
||||||
source = string(content)
|
source = string(content)
|
||||||
} else {
|
} else {
|
||||||
|
stat, _ := os.Stdin.Stat()
|
||||||
|
if (stat.Mode() & os.ModeCharDevice) != 0 {
|
||||||
|
_ = cmd.Help()
|
||||||
|
os.Exit(0)
|
||||||
|
}
|
||||||
|
|
||||||
content, err := io.ReadAll(os.Stdin)
|
content, err := io.ReadAll(os.Stdin)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error reading stdin: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error reading stdin: %v\n", err)
|
||||||
|
|||||||
Reference in New Issue
Block a user