On 2010-03-10, Chris Sutcliffe wrote:
> > I'd like to capture the stderr output from a program and capture it in
> > a quick fix window.  So far I've tried:
> >
> > :!command 2>command.out
> > :cf command.out
> > :copen
> >
> > However, when running 'command 2>command.out' from within vim the
> > command.out file is empty.  Running this outside of vim, command.out
> > captures the stderr messages generated by the command.  Is there some
> > trick to capturing stderr?
> 
> I should add that I'm running vim 7.2.385 self-compiled on Cygwin.

It seems to work for me.  I created the following test script,
stdtest:

    echo "this is stdout"
    echo "this is stderr" >&2

Then I executed the following from within vim:

    :!stdtest > std.out
    :!stdtest 2> std.err

and checked the contents of std.out:

    this is stdout

and std.err:

    this is stderr

I'm running vim 7.2.330, also self-compiled on Cygwin (1.5).  I ran
vim as "vim -N -u NONE" as well as with my normal configuration and
the results were the same.

Regards,
Gary

-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to