On Sat, 19 Aug 2017, Mark Volkmann wrote:
> I noticed that I can
> define a function in a .fish file that just echoes text,
> call the function as a command to see the text,
> modify the text in the file,
> save the file,
> run the function again and NOT see the change,
> run it again and see the change.
> Why is there a delay in seeing the result of the change?
> The delay seems to be about two seconds.

fish will reload a function file if it hasn't been loaded in the 
"staleness interval", which is currently fifteen seconds (this is an 
implementation detail - don't rely on it being that long or short!)

This is to avoid thrashing the filesystem when repeatedly calling the same 
function - such as in scripts. Slow filesystems like NFS are particularly 
vulnerable to this sort of problem.

The value could possibly be tuned downwards a bit, but I think we would 
want to have a discussion about that on GitHub.

David Adam
fish committer
zanc...@ucc.gu.uwa.edu.au

------------------------------------------------------------------------------
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