【问题标题】:Aptana Studio 3 terminal strange indentation characters in WindowsWindows中的Aptana Studio 3终端奇怪的缩进字符
【发布时间】:2013-07-23 02:46:05
【问题描述】:

我在 Windows 7 上使用 Aptana Studio 3 在 Ruby 中进行开发。但是,当我尝试使用内置终端运行 rspec 或 git 等命令时,我得到的是奇怪的字符而不是缩进。在下面的示例中,除了这些奇怪的字符外,一切正常。实际上,问号字符在终端中显示为左箭头。

我尝试搜索 [aptana] [终端],但找不到其他有类似问题的人。有人知道这里发生了什么吗?

Jake@JAKE-PC ~/My Documents/Aptana Studio 3 Workspace/user-service (master)
$ rspec spec/service_spec.rb
D, [2013-07-22T19:19:24.021708 #6564] DEBUG -- : env: test
D, [2013-07-22T19:19:24.080711 #6564] DEBUG -- : db/test.sqlite3 database connection established...
D, [2013-07-22T19:19:24.222719 #6564] DEBUG -- : fixture data created in test database...

service
  GET on /api/v1/users/:id
?[32m    should return a user by name?[0m
?[32m    should return a user with an email?[0m
?[32m    should not return a user's password?[0m
?[32m    should return a user with a bio?[0m
?[32m    should return a 404 for a user that doesn't exist?[0m
  POST on /api/v1/users
?[31m    should create a user (FAILED - 1)?[0m

Failures:

  1) service POST on /api/v1/users should create a user
     ?[31mFailure/Error:?[0m ?[31mlast_response.should be_ok?[0m
       ?[31mexpected ok? to return true, got false?[0m
?[36m     # ./spec/service_spec.rb:73:in `block (3 levels) in <top (required)>'?[0m

Finished in 1.2 seconds
?[31m6 examples, 1 failure?[0m

Failed examples:

?[31mrspec ./spec/service_spec.rb:67?[0m ?[36m# service POST on /api/v1/users should create a user?[0m

【问题讨论】:

    标签: windows terminal aptana


    【解决方案1】:

    你看到的奇怪的东西——]36m 等等——是应该改变类型颜色的代码。 rspec 将以红色显示失败的测试,并以绿色显示传递信息。 Aptana 终端无法处理这些颜色代码,因此您会看到垃圾(文字)字符。 不幸的是,这个问题与 eclipse for windows 代码的编写方式有关,所以如果要修复它,首先需要更改 eclipse 中的代码,然后是 aptana 代码。

    除了 Eclipse,您还可以运行控制台(Windows 命令)窗口,并在那里运行您的 rspec 测试。有 2 个简单的选项可以让颜色代码在 Windows 的控制台窗口中工作:

    1. 安装 ANSICon - 这将使您的 Windows 终端(命令窗口)能够显示 rspec 使用的颜色。 RailsBridge.org has instructions for it.(注意:我有一个 Windows 7 x64,这对我不起作用。这导致我选择了下一个选项......)

    2. Install ConEmu ("Console emulator") 这不仅支持颜色,还可以打开多个控制台(同一窗口中的不同选项卡),并设置打开新控制台时运行的命令窗户。我使用这个(NAYY)并且喜欢它。

    【讨论】:

    • 谢谢!那确实回答了我的问题。不过关于 aptana 的问题。
    猜你喜欢
    • 1970-01-01
    • 2013-09-15
    • 1970-01-01
    • 1970-01-01
    • 2012-02-27
    • 2012-02-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多