George
George

Reputation: 7317

Preserving Bash Colors When Shelling out Commands in Haskell

Running ls --color=auto in bash shows directories as blue on my machine. Yet running stdout (inshell "ls --color=auto" empty) in Turtle loses all said color data. Is there a way to preserve coloring data?

Upvotes: 1

Views: 68

Answers (1)

Brian McKenna
Brian McKenna

Reputation: 46218

The "auto" part means ls will only use colour when it knows that stdout is a "real" terminal. If you change to "always" then it will always use colour:

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

Upvotes: 4

Related Questions