在Windows cmd上显示unix颜色(例如←[31m) [英] Displaying unix color on windows cmd (e.g. ←[31m)

查看:459
本文介绍了在Windows cmd上显示unix颜色(例如←[31m)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近开始在Windows 7的rails开发上做一些ruby,并发现了一些命令(rspec,guard等)输出颜色代码,只是显示在Windows命令行上的文本(或通过控制台2我用)。例如:

I've recently started doing some ruby on rails development on Windows 7 and have found a number of commands (rspec, guard, etc) output colour codes that just show up in text on the windows command line (or through Console2 which I use). eg:

←[31mrspec ./spec/views/users/index.html.erb_spec.rb:21←[0m ←[36m# users/index renders a list of users←[0m
←[31mrspec ./spec/requests/homes_spec.rb:9←[0m ←[36m# Homes GET /homes ←[0m
←[31mrspec ./spec/views/users/new.html.erb_spec.rb:13←[0m ←[36m# users/new renders new user form←[0m
←[31mrspec ./spec/views/users/show.html.erb_spec.rb:13←[0m ←[36m# users/show renders attributes in <p>←[0m

我知道你可以通过从配置文件中取出 - color 命令来关闭大多数工具的颜色例如.respc文件),但是它是一个痛苦,必须这样做的一切,颜色编码会很好。

I'm aware you can turn the color off for most tools by taking the --color command out out of the config files (e.g. the .respc file), but it's a pain to have to do this for everything and colour coding would be nice.

任何想法如何让我在Windows中正常显示?

Any ideas how I can get these to display properly in Windows?

推荐答案


  1. 将控制台2更改为 ConEmu (我是这个控制台的作者)。它支持Ansi x3.64

  1. Change Console2 to ConEmu (I'm the author of this console). It supports Ansi x3.64

或者,您可以使用AnsiCon启用Ansi

Or, you may use AnsiCon to enable Ansi

这篇关于在Windows cmd上显示unix颜色(例如←[31m)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆