"Make" output ANSI escape code colour formatting

Here is an odd one: I have my makeprg set to a custom make command with errorformat set to pick up my custom error format. This all works in nvim. Very happy. However, the actual build output that spills out on the screen is lacking the colourized ANSI escape code formatting and instead shows all the escaped characters. This would be no surprise but native Vim shows it all properly formatted.

e.g. Vim shows:

"Return value is (0). ALL GOOD! "

Where “ALL GOOD” is shown in green.
However nvim shows:

Return value is (0). ^[[0;32mALL GOOD! ^[[0;33m

I feel there is some option not set. I’m not sure how vim/nvim filters buffer output before displaying it.
Anyone?

This is a very old issue:

1 Like

I’m not sure how this is related, though from your link I see there has been discussion about ANSI escape codes from :term and !.
However this is the built in :make function. But perhaps that is just launching the shell. (I’m quite new to calling :make within vim/nvim).
Are you suggesting this is a long standing (ie still unfixed) issue?

“This is not a bug, it is the new behavior of bang commands: We no longer spawn the program with it’s stdout connected to Nvim tty, instead we open a pipe, read output and display to the user. This is the only way the bang commands will be consistent across UIs, so programs designed to be used interactively from the terminal will no longer work from inside nvim.”

Doh!

Oddly running my makefile from :term works absolutely fine. Lovely coloured text and spinners etc.
Has this been fixed but :make overlooked?

Maybe :make can be made to use :terminal, like K. I’m not familiar with :make either.

I think, for the moment, my only solution is to run nvim in one tmux window and native vim in another and do the :make in that. At least then I’ll be able to jump to the errors.

if you want display color on output you can try this it not perfect but it have color

Thanks but colour seems to work ok in the terminal, its just the :make output. Not just colour but carriage returns. Sounds like this has been dropped for good reason though.

I use a terminal now, but in the past, when there was no terminal, I used GitHub - powerman/vim-plugin-AnsiEsc: ansi escape sequences concealed, but highlighted as specified (conceal)

Personally, I strongly recommend using the terminal as a task runner.