Rspec colors with Conemu - colors

I'm trying to get colors to show up on my Windows 7 x64 machine when running rspec. I've tried console2 and ansicon but that makes Ruby crash. I've got ConEmu installed and Ruby runs again but I'm not getting any colors for rspec. Also in lines I expect to see color, they are preceded by text like [31m or [36m (this also occurs with cmd.exe).
Thanks for any help
Sharon

To enable ANSI X3.64 processing in ConEmu you must enable two options on "Features" page:
"Inject ConEmuHk"
"ANSI X3.64 / xterm 256 colors"
In fact, if you need ANSI processing in the root process only (cmd.exe for example) - there is no need in enabling "Inject ConEmuHk". But in most cases, when you run smth (which uses ANSI) from root shell - "Injects" are required.
ATM, latest alpha version recommended, there was some lags in the current stable build.

Related

How do I get coloured output back for Cucumber in ConEmu?

Cucumber gives coloured output in Windows 7 (64-bit) command prompt with ANSICON 1.6.0, but no longer in the ConEmu terminal manager.
Cucumber
Cucumber.yml exists in \config folder
Cucumber.yml contains default: --color
ConEmu
Settings > Features > Inject ConEmuHk is checked
Settings > Features > ANSI X3.64 / xterm 256 colors is checked
%ConEmuANSI% returns "ON"
ls --color does return coloured output
Version status: 141004 preview
ConEmu appears to be fine, yet Cucumber appears to be configured correctly as well considering coloured output works in the command prompt. Any ideas?
Example output from Cucumber, as requested (these passing steps would previously show in green):
Scenario: Visit the client site # client\features\age_gate.feature:8
Given I am a new visitor # client/features/step_definitions/age_gate.rb:1
When I visit the client website # client/features/support/navigation.rb:1
Then I am shown the age gate # client/features/step_definitions/age_gate.rb:6
Old build was used. Update to latest alpha.

vim-powerline does not have the correct appearance

I installed it with Vundle and my .vimrc look contains the following
" Powerline setup
set guifont=DejaVu\ Sans\ Mono\ for\ Powerline\ 9
set laststatus=2
I am using the default Gnome Terminal than comes with Ubuntu 14.04. I don't know if it installed correctly (I followed this Vim as Python IDE tutorial) but it does not look anything like the screenshots.
Here is what is it meant to look like: Official Screenshots
And here is what it actually looks like:
As you can see, zero similarity.
The 'guifont' option applies only to GVIM. In the terminal, Vim uses the default terminal font. So, you need to go to Gnome Terminal's settings (Edit > Profile Preferences > /General\ > Font:) and change the font there, too (assuming Powerline supports the terminal at all, which I don't know).
Also, check how many colors Vim detects via :set t_Co?; you can influence / correct that by defining the correct $TERM value, probably gnome-256color for your.
Have you installed the patched fonts?
https://github.com/powerline/fonts

Why can't this menu item work?

I got this in my vimrc:
:so menu_format.vim
and in menu_format.vim, this:
"... other menu items that work
menu Format.nbsp_space <ESC>:%s# # #gec<CR> //(the 1st blank is 0xa0, the 2nd is 0x20)
"... other menu items that work
On Windows it works (been using it for a while), but on Linux Mint 17 vim gives:
E319: Sorry, the command is not available in this version.
I tried %s# # #gec on command line, it worked, too!
I knew how to fix this: %s#[\xa0]# #gec would do. I just wanted to know why there is such a difference, and it made me doubt the portability of my vim scripts.
BTW, I built vim (7.4.560) on both Linux and Windows with the same configuration, both use the same menu_format.vim.
It looks like you only have the minimal version of Vim named vim-tiny; it only provides a minimal vi-compatible implementation. The E319 implies that the :menu command is not available, the :substitute does look fine and should work.
To get the full Vim (and graphical GVIM), install the following package:
$ sudo apt-get install vim-gnome

ANSI color support using Groovy on Windows XP

Trying out the examples found on pleac.sf.net, I'm not able to get an example of ANSI colors to work on my WinXP box (Works fine on MacOS). What I've found is that on my WinXP machine, in both cygwin & DOS prompts, groovysh --color (and 'groovysh --terminal=unix') shows escape codes rather than the expected colored prompt. grep --color works just fine in the cygwin terminal. I can't find anything obvious that I'm doing wrong. Any ideas?
Note: I'm using Groovy 1.6.0
Update: I've tried adding ANSI.sys to my config.nt mentioned here Groovy-dev Mailing List but it didn't fix the problem (tried rebooting too).
I have the same problem, my solution is ugly but simple: Pipe groovy output to cygwin cat.exe
Suppose your script red.groovy is:
println "\u001B[31mI'm Red\u001B[0m Now not"
Then from command shell
groovy.bat red.groovy | cat
will display the right colors.
Of course you can write your own native code that handle the ANSI codes.
The thing is, you'd have to add DOSONLY to your CONFIG.NT as well to make the ANSI.SYS driver work, and then it would only work for COMMAND.COM which emulates DOS 5.0. Regular Command Prompts (CMD.EXE) do not support ANSI colors at all, afaict.
I don't know much about how cygwin handles it.
The Groovy site says to do this for cygwin:
groovysh --terminal=unix
For the winxp command shell, as far as I know, there is no ANSI support at all, not even with ansi.sys. Colors are supported through some MS API only.
A workaround in cygwin is to launch xterm or rxvt and run it there.

Why is vim syntax highlighting on different terminals?

I am running a standard installation of OpenSuse 42.3. I ssh to the Opensuse machine via my MacOS computer. When I use vim to view files in the terminal window the syntax highlighting is pleasant to look at. I also have a Docker image of a stock installation of OpenSuse 42.3 installed on my OpenSuse machine. If I boot up the container and open a python file with vim within the container, the syntax highlighting looks different. I did a diff on the contents of the /usr/share/vim/vim74/syntax/python.vim, and there were no differences between the syntax file that is being used on the OpenSuse host and the OpenSuse container.
Below on the left is what I see when I ssh from my Mac to the OpenSuse machine and open a python file. On the right is what I see when I start the docker container ( still in the same terminal window that I started for the image on the left).
Shouldn't the display on the terminal window of the syntax highlighted file be the same if the vim syntax files are the same?
The highlighting in the terminal can depend on the number of available colors. Some colorschemes have separate branches of color definitions depending on how many are available. You can check for yourself via
:set t_Co?
You probably get 256 for TERM=xterm-256color and only 16 for TERM=xterm.
Though you can just force :set t_Co=256 and reload your colorscheme, it's better to fix the root cause, i.e. the wrong TERM value.

Resources