Open saleyn opened 3 years ago
When I try it here it does remove all color, but leaves the bold font in place. All output styling of this kind can be removed by using TERM=dumb
as an environment variable, which lets rebar3 assume that the receiving end isn't a full blown terminal. If you're building from an editor, that's probably what you should specify as a terminal option?
That does work, though I would assume that the intention of the REBAR_COLOR was to remove all color escaping chars including bold, no?
Do you know if there is a way to have vim set it the TERM automatically when executing :make
? The desired functionality would be to leave the colors when typing make
from the shell, and remove colors when executing make from the vim
.
Actually, I think I figured it out:
$ cat ~/.vim/ftplugin/erlang.vim
setlocal makeprg=TERM=dumb\ make
Yeah that's a good question. I assumed that turning off the color meant the colors and not the color codes, so I went digging to see and it may have been accidental:
https://github.com/erlang/rebar3/blob/master/src/rebar_log.erl#L114-L115 sets the color code for bold text, and sends it to erlware_common's logging module, which is seemingly the thing that adds red (https://github.com/erlware/erlware_commons/blob/master/src/ec_cmd_log.erl#L167-L169).
This means that erlware_commons would normally filter out the bold, and its addition might be considered somewhat buggy on our end. We could arguably do the check on our side of it before bolding as well I guess, drop the bold, or patch up erlware_commons to add the bold we want as well.
@tsloughter opinions?
Environment
Current behaviour
$ REBAR_COLOR=none rebar3 compile Verifying dependencies... Analyzing applications... Compiling payments Compiling src/payments_engine.erl failed
%% <-- This line appears in bold color
src/test.erl:64:69: syntax error before: '{'Because of this
vim
is occasionally unable to determine the file name of the module with error, and cannot jump to that line after:make
is invoked.Expected behaviour
All output should not be colorized.