Sorry, I should have replied to the list rather than just Mark.

----- Original message -----
From: Greg Reagle <greg.rea...@umbc.edu>
To: Mark Volkmann <r.mark.volkm...@gmail.com>
Subject: Re: [Fish-users] functions as commands
Date: Sat, 19 Aug 2017 10:12:27 -0400

On Sat, Aug 19, 2017, at 09:55, Mark Volkmann wrote:
> I've been learning about fish for the past two weeks.
> Initially I thought that custom functions could do anything a "normal" 
> command cound do.
> But today I learned that functions cannot be run in the background.
> For example, if I write myfn.fish, I can execute it by just entering "myfn".
> But I cannot run it in the background with "myfn &".
> Also, if I'm running a long running function, I can't move it to the 
> background with ctrl-z.
> Why are those not supported?

Functions have several limitations that shell scripts do not have.  They
are not identical, and they are not interchangeable in all cases.

http://fishshell.com/docs/current/index.html#job-control has:
"Note that functions cannot be started in the background. Functions that
are stopped and then restarted in the background using the bg  command
will not execute correctly."

Try looking at github issues.  These two discuss some of the "why" and
"how":
https://github.com/fish-shell/fish-shell/issues/238
https://github.com/fish-shell/fish-shell/issues/563

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to