4 ms·
> Smart tab completion not only for the commands but for the arguments as well, and it apparently does that by parsing man pages. And it does this every time y
by revscat 5y ago
> Smart tab completion not only for the commands but for the arguments as well, and it apparently does that by parsing man pages.
And it does this every time you spawn a shell. So if you have set your login shell to fish, then every time you launch a shell it loads all the fish plugins like this one, and that slows it down. And you can’t turn it off, or couldn’t the last time I checked around a year ago. Insult to injury? The PR where this was requested was closed by the devs as “wontfix”.
This, and it’s lack of POSIX compatibility, made me switch back to zsh.
- iamevn 5y agodo you have fish_update_completions somewhere that runs when you start a shell? maybe ~/.config/fish/config.fish?
- ilaksh 5y agoI have been using fish for years. I don't have those issues because I just leave the default as bash and run the fish command manually when I log in. Then if I have some incompatibility (pretty rare) I can just type 'exit'.
- faho 5y ago>And it does this every time you spawn a shell. It does not. The completion generation is on first start and whenever you run `fish_update_completions`. (note that the importance of man parsing is often quite overstated, it only gets you so far, all the advanced completion stuff is hand-written) Source: I'm a fish dev.
- pxc 5y agoOn NixOS, we generate the completions on behalf of users at install time, so they never have to see a slow startup at all. Fish makes it easy to do! Thanks :D
- pxc 5y ago> So if you have set your login shell to fish, then every time you launch a shell it loads all the fish plugins like this one, and that slows it down Fish completions and functions are lazy-loaded, so this doesn't happen unless you write your config to force it to happen. Fish also provides you with functions you can use to check whether a shell instance is a login shell, is interactive, or is just being invoked as (part of a) script. If you do have some heavy-duty stuff you want to run on startup for your login shell or your interactive shells, you can do that selectively and keep Fish startup for other purposes fast.