skywind3000 / asyncrun.vim

:rocket: Run Async Shell Commands in Vim 8.0 / NeoVim and Output to the Quickfix Window !!
https://www.vim.org/scripts/script.php?script_id=5431
MIT License
1.86k stars 112 forks source link

how to enable terminal color output? #72

Open y9c opened 7 years ago

y9c commented 7 years ago

the output image

expected result image

skywind3000 commented 7 years ago

ANSI color escape code is not supported, and I don't have any plan for that. You should disable gcc color output, errors will be highlighted by quickfix window itself.

noboruma commented 5 years ago

Looks like this plugin works fine: https://github.com/powerman/vim-plugin-AnsiEsc

dakeryas commented 5 years ago

Running AnsiEsc in the quickfix window opened by an AsyncRun command does work, but how does one combine both in a single command?

I am running two commands separately at the moment:

:AsyncRun clang++ -fdiagnostics-color=always  -c % -o /dev/null
:AnsiEsc

I have tried piping the commands, e.g.

:AsyncRun clang++ -fdiagnostics-color=always  -c % -o /dev/null | AnsiEsc

to no avail.

skywind3000 commented 5 years ago

-post=xxx

oliverdain commented 6 months ago

As an alternative, it'd be nice if we could choose environment variables that get set for any :AsyncRun call. In particular, in my case if I run :AsyncRun echo $TERM I get:

|| [echo $TERM]
|| xterm-256color
|| [Finished in 0 seconds]

so my compilers, etc. think the quickfix window supports colors and that breaks errorfmt. I can update which commands I run to turn off colors for each of our build tools (linters, compilers, code generators, etc.) but it'd be easier if we could just globally set the terminal config so it tells everything that colors aren't going to work.

Is that possible?

skywind3000 commented 6 months ago

use this:

:AsyncRun -mode=term -pos=TAB  xxx
oliverdain commented 6 months ago

use this:

:AsyncRun -mode=term -pos=TAB  xxx

@skywind3000 thanks for the suggestion. When I do that it doesn't populate the quickfix window so I can't jump to errors. The reason I want to eliminator the color output is so my errorfmt works and I can quickly handle compiler and linter errors. Is there a way to use -mode=term and still have quickfix like functionality?