如何通过Ruby脚本保存在命令输出的颜色(How to preserve colour in com

2019-10-20 06:38发布

ls -la # This gives a coloured output.

但,

puts %x{ ls -la } # The colours aren't preserved here.

有没有办法让彩色输出?

文章来源: How to preserve colour in command output through Ruby script