2012/5/30 ridiculous_fish <[email protected]>
...

5. What you're seeing is the "internalized scripts" behavior, where at
> build time, fish compiles all the default functions into itself (as C
> strings). This reduces the number of files touched at launch. I did this
> under the belief that these functions generally depended on each other, and
> ought not to be modified. However, since this is causing problems, we
> should restrict the functions internalized in this way, or eliminate the
> optimization altogether.  I filed
> https://github.com/ridiculousfish/fishfish/issues/15
>
>  Can you share which functions from /usr/local/share/fish/ you override?
>
> (The fish_prompt case is particularly bad - I didn't realize the effect
> that would have. I put my prompt in config.fish)
>

Ha! The original rationale for creating $prefix/share/fish/functions was an
optimization. Specifically, the fish startup script was becomming so large
that the fish process was taking up megabytes of memory. By loading
functions on demand and automatically unloading them when they are no
longer needed, quite a bit of memory could be saved. The biggest memory
savings came from autoloading humongous completion lists like those for
rpm, gcc or gpg on demand. And here we are, ten years later, memory is
cheaper but disks are as slow as ever, so you go in and reverse the
optimization. :-) Though by inlining the code into the binary, you're
sharing the data across all fish instances on a system, which might be
significant on many systems.

Might I suggest that you treat your inlined optimized functions as an
implicit final entry in $fish_function_path instead? That variable is used
to get sane scoping in that the fish package can include a function called
poof by defining it in $prefix/share/fish/functions/poof.fish. The system
administrator can, if she wishes, then overide that function with a site
specific version by defining it in /etc/fish/functions/poof.fish. But if
the user doesn't like the site wide version, he can in turn define his own
version in ~/.config/fish/functions/poof.fish. All you'd have to do to keep
things working as intended while still saving stat calls is to only use
your inlined function definitions as a last resort if no function can be
found on the fish path.

Though on the other hand, how much are you really gaining. As long as you
support $fish_function_path, those directories will still have to be
checked, right? Have you meassured the performance benefits?

6. There is a color "fish_color_autosuggestion" which defaults to #555
> (gray), but if your term doesn't support term256, you won't see it. Maybe
> we could pick a color for classic 16 color terms. What term are you using?
>

Ugh. Terminals are the bane of any terminal using application. set
fish_color_autosuggest --bold black will work on most terminals, but hardly
all. :-/

Also, you might want to change __fish_config_interactive.fish:

        if not set -q __fish_init_1_23_0
                ...
                set_default fish_color_operator cyan
                set_default fish_color_quote brown
-                set_default fish_color_autosuggestion 555
                set_default fish_color_valid_path --underline
                ...
        end

+        if not set -q __fish_init_2_0_0
+                 set -U __fish_init_2_0_0
+                set_default fish_color_autosuggestion 555
+         end

The point of those weird if blocks is that they should run exactly once for
every user. Each time you release a new version of fish with a new stuff to
run once, you create a new such block and test for a univesal variable
containing the version number of your release.

The current code was added in an older such block, meaning that it wont get
run for any current fish users.

Axel


> On May 30, 2012, at 5:16 AM, Maxim Gonchar wrote:
>
> > Hi,
> >
> > So I'm trying new fish and have some questions and notes. It became
> really fast and amazing.
> >
> > 1) On archlinux default python is python3. So internalize script and
> webconfig scripts do not work out of the box, until i replace
> /usr/bin/python by /usr/bin/python2.
> >
> > 2) I see that I can not now execute directories. I.e. I can not use '..'
> as command to go to the upper directory.
> > Of course I can catch the event to handle it. But it doesn't colorize
> correct paths as green now. Is this feature completely deleted?
> >
> > 3) __fish_config_interactive.fish contains a command 'which -s'
> > I do not know what -s should mean, but my 'which' doesn't support this
> option (I've tried on arch, debian and ubuntu).
> > The other thing is that which outputs to the stderr if command not
> found. So it's better to use ^/dev/null redirection as well.
> >
> > The problem is that 'which -s command-not-found' is also hardcoded in
> builtin_scripts.cpp, so it's not easy to understand why it keep claiming,
> even after modifying the __fish_config_interactive.fish
> >
> > 4) It seems that commands are interpreted even if they are not to be
> executed:
> > 'false; and dfgsfhsfhethr' will cause an error.
> >
> > That's bad, because it shows warnings if I try to test if command is
> valid:
> > type sdfsdfsdf >/dev/null; and sdfsdfsdf
> >
> > 5) It ignores my prompt. It seems that it ignores my functions, if they
> override functions from /usr/local/share/fish.
> > It ignores them, even if I delete /usr/local/share/fish from
> $fish_function_path.
> > I also can not edit fish functions from 'share' with funced.
> >
> > 6) I like the idea of autosuggestions, I feel very comfortable and
> natural with them. I would suggest to add the possibility to set a color to
> the auto-suggested part (blinking?).
> > Now it's the same as the other part of the command and if you loose your
> attention for a while, you think that you get the command already and you
> get an error when you try to execute it.
> >
> > best regards,
> > Maxim
> >
>
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Fish-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/fish-users
>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Fish-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to