-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make handling of command output more robust #70
Make handling of command output more robust #70
Conversation
9b141fe
to
f1a1501
Compare
Hey @marwing, I've gotten around to looking into this at last, and I'm fairly happy with the results. Could I ask you to test these changes too? Both Neovim and Vim should now handle output properly, and you should see the Ninja output you'd expect in a normal terminal. I haven't tested on Windows yet, but will do soon. Feel free to look at the code changes too, but you don't have to. TL;DR I am now printing commands' output (almost) directly into the Vim-CMake console, and only then processing the raw output to strip out ANSI sequences (which is useful for generating the Quickfix list of errors). |
@marwing one more question: I can't seem to have Ninja output colored messages, unless I set Fun fact, Vim sets the Edit: forgot to say that I also don't see colors when running Ninja just in my terminal, outside of Neovim/Vim. |
From what I can tell
This is unfortunately expected with ninja (ninja-build/ninja#174). Since I use ccache with cmake I already have CMake set up with a global env variable (since cmake 2.24, flag before) to enable colors with clang and gcc (https://gitlab.com/marwing/dotfiles/-/blob/5a6ee75daf1e5244d81eb19c5545a239cb8cde20/.config/zsh/.zprofile#L49) so I didn't even notice this. I would guess that people who use ninja already know about and deal with this.
That seems sort of stupid. Have you found any reason for this?
Do you think it is a good idea to default to xterm-256color? The user may not be in a terminal that supports 256 colors. |
Ah, what errors? What version of Vim did you test with? I don't see anything on my end.
Not really, I tried to find out why but couldn't get anywhere.
Probably not, I changed it to One issue I still do see is that I can't seem to be able to set the PTY's width in Vim, which Ninja relies on to output properly truncated lines. This results in the output to be messed up if the width of the Vim-CMake console is smaller than some of the lines output by Ninja (you can try to run Vim-CMake in a narrow terminal, you should see this issue too). I've opened an issue upstream: vim/vim#11476, let's see if I get any response. |
These:
with version:
and only vim-cmake master in packpath.
That's interesting. I'm curious of the outcome of this. I would however not block this pr because of that as I doubt too many people run that narrow of a vim instance and the output is not too bad (this patch actually seems to improve it for me). I would put this in a follow up instead and push this as quickly as reasonable to make ninja usable in neovim. |
Regarding your issues in Vim, yes I'd open a new issue, as I don't have a quick answer. Please also try to reproduce with a minimal vimrc when posting the issue. For the rest, yes I think I'll just merge this PR (I'll actually wait to merge #64 first), and open a follow-up issue for terminal width in Vim. |
I'm merging this one (@marwing FYI). A few gotchas:
|
No description provided.