[Fish-users] default shell for apps

2006-09-19 Thread Martin Bähr
hi, i just stumpled onto the following problem when trying to call an
external program from vi:

in vi i simply selected arange of lines and did:
:','!sort

',' is the lines to be sorted,
and sort is the command.

the command that vim then actually produces is the following:

fish: Command substitutions not allowedIllegal command name #(sort)#
Standard input: (sort)  /tmp/v744983/1 /tmp/v744983/2

now this is cearly not a bug in fish, it is arguably one in vim.
and it is surely a difference of expectations, because vim assumed to have a
posix shell here. and this is probably one of the reasons why everyone
insists so much on posix compatibility for shells.

the question for me is: how can fish handle this situation which could
come up in any place where the default shell of the user is used, but is
expected to be posix.

should a bugreport to vim be sent?
might help in the long run, but won't do any good inthe short run.

can the user be educated about the problem?
this error happened because fish was called from another program which
most like assumed to be a posix shell. you need to fix that program and
tell it not to call fish but a posix shell
for this, can the calling program be detected by name? ie can fish
figure out that it was called by vim and respond with the right
instructions how to configure vim?
at least a set of instructions for all kinds of programs might need to
be assembled.

should the problem be handled transparently?
ie: take the failing commandline and feed it to /bin/sh and return the result

more ideas?

greetings, martin.
-- 
cooperative communication with sTeam  - caudium, pike, roxen and unix
offering: programming, training and administration   -  anywhere in the world
--
pike programmer   travelling and working in europe open-steam.org
unix system-  bahai.or.atiaeste.(tuwien.ac|or).at
administrator (caudium|gotpike).org  is.schon.org
Martin Bähr   http://www.iaeste.or.at/~mbaehr/

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] default shell for apps

2006-09-19 Thread Martin Bähr
On Wed, Sep 20, 2006 at 03:35:46AM +0200, Martin Bähr wrote:
 hi, i just stumpled onto the following problem when trying to call an
 external program from vi:
 the command that vim then actually produces is the following:
 
 fish: Command substitutions not allowedIllegal command name #(sort)#
 Standard input: (sort)  /tmp/v744983/1 /tmp/v744983/2

ok, the problem appears to be that vim looks at the SHELL variable.
the following works:
env SHELL=/bin/bash vi filename
but this works as well:
env SHELL= vi filename

this suggests that it might be helpful to hide the shell from certain
apps. but which ones would that be?

i still think that the best way would be to teach app developers that
they must not expect that shells are posix compatible but should rather
explicitly call a posix shell if they need one.

greetings, martin.
-- 
cooperative communication with sTeam  - caudium, pike, roxen and unix
offering: programming, training and administration   -  anywhere in the world
--
pike programmer   travelling and working in europe open-steam.org
unix system-  bahai.or.atiaeste.(tuwien.ac|or).at
administrator (caudium|gotpike).org  is.schon.org
Martin Bähr   http://www.iaeste.or.at/~mbaehr/

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] default shell for apps

2006-09-19 Thread James Vega
On Wed, Sep 20, 2006 at 03:35:46AM +0200, Martin Bähr wrote:
 hi, i just stumpled onto the following problem when trying to call an
 external program from vi:
 
 in vi i simply selected arange of lines and did:
 :','!sort
 
 ',' is the lines to be sorted,
 and sort is the command.
 
 the command that vim then actually produces is the following:
 
 fish: Command substitutions not allowedIllegal command name #(sort)#
 Standard input: (sort)  /tmp/v744983/1 /tmp/v744983/2
 
 now this is cearly not a bug in fish, it is arguably one in vim.

A quick and dirty solution (which I use) is to add the following to your
~/.vimrc:

  if $SHELL =~ 'fish'
  set shell=/bin/sh
  endif

I talked with Axel about this before (I think it was off-list) and I'm
pretty sure I ended up emailing Bram about it afterwards.  I'll see if I
can find those emails and whether or not anything more significant than
my above solution came out of them.

James
-- 
GPG Key: 1024D/61326D40 2003-09-02 James Vega [EMAIL PROTECTED]


signature.asc
Description: Digital signature
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users