[bug] shellpipe is not set as documented

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[bug] shellpipe is not set as documented

Britton Kerin
The documentation for the 'shellpipe' option in
runtime/doc/options.txt includes this:


     For Unix the default it "| tee".  The stdout of the compiler is saved
     in a file and echoed to the screen.  If the las'shell' option is "csh" or
     "tcsh" after initializations, the default becomes "|& tee".  If the
     'shell' option is "sh", "ksh", "zsh" or "bash" the default becomes
     "2>&1| tee".  This means that stderr is also included.
     The initialization of this option is done after reading the ".vimrc"
     and the other initializations, so that when the 'shell' option is set
     there, the 'shellpipe' option changes automatically, unless it was
     explicitly set before.

The comments in src/option.c says this:

     /*
      * Set 'shellpipe' and 'shellredir', depending on the 'shell' option.
      * This is done after other initializations, where 'shell' might have been
      * set, but only if they have not been set before.
      */

 [snip]

     /*
      * Isolate the name of the shell:
      * - Skip beyond any path.  E.g., "/usr/bin/csh -f" -> "csh -f".
      * - Remove any argument.  E.g., "csh -f" -> "csh".
      */

Neither of these seem consistent with what actually happens:

     1. Directory parts are indeed removed as the code (but not
        the documentation) indicates.

     2.  Subsequent arguments do not seem to be removed, or
          at least they still manage to cause the shellpipe option
          to be set to the non-bash default in my case:

               set shell=bash\ --rcfile\ ~/.vim_bash

          in the .vimrc causes shellpipe to end up as '| tee'.

Britton

--
You received this message from the "vim_dev" 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 | Threaded
Open this post in threaded view
|

Re: [bug] shellpipe is not set as documented

James Vega-3
On Wed, May 12, 2010 at 11:12 AM, Britton Kerin <[hidden email]> wrote:

>  [snip]
>
>      /*
>       * Isolate the name of the shell:
>       * - Skip beyond any path.  E.g., "/usr/bin/csh -f" -> "csh -f".
>       * - Remove any argument.  E.g., "csh -f" -> "csh".
>       */
>
> Neither of these seem consistent with what actually happens:
>
>      1. Directory parts are indeed removed as the code (but not
>         the documentation) indicates.
>
>      2.  Subsequent arguments do not seem to be removed, or
>          at least they still manage to cause the shellpipe option
>          to be set to the non-bash default in my case:
>
>               set shell=bash\ --rcfile\ ~/.vim_bash
>
>          in the .vimrc causes shellpipe to end up as '| tee'.

There is an item in the todo about this:

Shell not recognized properly if it ends in "csh -f". (James Vega, 2009 Nov 3)
Find tail?  Might have a / in argument.  Find space?  Might have space in
path.

http://code.google.com/p/vim/source/browse/runtime/doc/todo.txt#58

--
You received this message from the "vim_dev" 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 | Threaded
Open this post in threaded view
|

Re: [bug] shellpipe is not set as documented

Bram Moolenaar
In reply to this post by Britton Kerin

Britton Kerin wrote:

> The documentation for the 'shellpipe' option in
> runtime/doc/options.txt includes this:
>
>
>      For Unix the default it "| tee".  The stdout of the compiler is saved
>      in a file and echoed to the screen.  If the las'shell' option is "csh" or
>      "tcsh" after initializations, the default becomes "|& tee".  If the
>      'shell' option is "sh", "ksh", "zsh" or "bash" the default becomes
>      "2>&1| tee".  This means that stderr is also included.
>      The initialization of this option is done after reading the ".vimrc"
>      and the other initializations, so that when the 'shell' option is set
>      there, the 'shellpipe' option changes automatically, unless it was
>      explicitly set before.
>
> The comments in src/option.c says this:
>
>      /*
>       * Set 'shellpipe' and 'shellredir', depending on the 'shell' option.
>       * This is done after other initializations, where 'shell' might have been
>       * set, but only if they have not been set before.
>       */
>
>  [snip]
>
>      /*
>       * Isolate the name of the shell:
>       * - Skip beyond any path.  E.g., "/usr/bin/csh -f" -> "csh -f".
>       * - Remove any argument.  E.g., "csh -f" -> "csh".
>       */
>
> Neither of these seem consistent with what actually happens:
>
>      1. Directory parts are indeed removed as the code (but not
>         the documentation) indicates.

I thought this was obvious.  I'll add a remark to avoid confusion.

>      2.  Subsequent arguments do not seem to be removed, or
>           at least they still manage to cause the shellpipe option
>           to be set to the non-bash default in my case:
>
>                set shell=bash\ --rcfile\ ~/.vim_bash
>
>           in the .vimrc causes shellpipe to end up as '| tee'.

Vim thinks the path is "bash --rcfile ~/" and the shell name
".vim_bash".  Since spaces in the path are not escaped it's difficult to
come up with a better solution.

I suppose on Unix we can assume the path does not contain a space.  I'll
make a patch that works that way.

--
hundred-and-one symptoms of being an internet addict:
29. Your phone bill comes to your doorstep in a box.

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

--
You received this message from the "vim_dev" 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