How to output my ruby commandline text in different colours

后端 未结 10 1864
青春惊慌失措
青春惊慌失措 2021-01-30 03:15

How can I make the puts commands I output from a commandline based ruby program colour? I would appreciated any references to how I call each different colour also.

Lets

10条回答
  •  自闭症患者
    2021-01-30 04:03

    use escape sequence \033 instead of \e as it is 100% posix compatible and will work on bsd-ish (e.g. osx) systems as well. the latter is a gnu extension.

提交回复
热议问题