在 Haskell 中删除命令时保留 Bash 颜色

Preserving Bash Colors When Shelling out Commands in Haskell

运行 ls --color=auto in bash 在我的机器上显示目录为蓝色。然而 运行 stdout (inshell "ls --color=auto" empty) 在 Turtle 中丢失了所有所述颜色数据。有没有办法保留着色数据?

"auto" 部分意味着 ls 仅在知道标准输出是 "real" 终端时才使用颜色。如果您更改为 "always" 那么它将始终使用颜色:

stdout (inshell "ls --color=always" empty)