简体   繁体   中英

Aptana Studio 3 terminal strange indentation characters in Windows

I am using Aptana Studio 3 on Windows 7 to develop in Ruby. However when I try to use the built-in terminal to run commands such as rspec or git, I get strange characters instead of indentation. In the example below, everything works fine except for these weird characters. Actually the question mark characters appears as a left arrow in the terminal.

I've tried searching SO for [aptana] [terminal], but couldn't find anyone else who had similar issues. Does anyone recognize what is happening here?

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

The weird stuff -- ]36m and the like -- that you are seeing are codes that should be changing the color of the type. rspec will show failed tests with red type, and passing information with green. The Aptana terminal is not able to handle these color codes, so you see the garbage (literal) characters. Unfortunately, the issue has to do with how the eclipse for windows code is written, so if it were ever to be fixed, first the code in eclipse would need to be changed, and then the aptana code.

You can run a console (Windows Command) window in addition to eclipse, and run your rspec tests there. There are 2 straightforward options for getting the color codes working in a console window on Windows:

  1. Install ANSICon - this will give your Windows terminal (command windows) the ability to show the colors that rspec uses. RailsBridge.org has instructions for it. (Note: I have a Windows 7 x64 and this didn't work for me. Which led me to the next option...)

  2. Install ConEmu ("Console emulator") This not only supports the colors, but you can have multiple consoles open (different tabs within the same window), and set up commands to run when opening a new console window. I use this (NAYY) and love it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM