-
-
Notifications
You must be signed in to change notification settings - Fork 438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bash autocompletion causes slow interactive login times #101
Comments
I recall something about this related to the fact that the default version of bash on macOS is really old. Using the nix version of bash as your login shell might resolve this if that's the case. |
@LnL7 I have: { pkgs, ... }: {
users.users.will = {
description = "Will Fancher";
home = "/Users/will";
shell = "/run/current-system/sw/bin/bash";
};
environment.shells = [ pkgs.bashInteractive ];
} So I thought I had that set up right. And in fact: $ echo $BASH
/run/current-system/sw/bin/bash
$ echo $BASH_VERSION
4.4.12(1)-release However, oddly enough, if I do these things directly from SSH then I get different results:
It's using EDIT: Weird:
|
With #109 non-interactive cases shouldn't suffer from this anymore, but unless that was the cause somehow there's not much that can be done about it I think. |
@LnL7 though it's definitely less of a problem for only interactive logins to be slow, I think it's still a problem. The issue should probably remain open and be renamed. |
Oh, I confused this with #98. |
@LnL7 How does NixOS avoid this problem? I remember reading somewhere that Bash can lazily load completions. Maybe we need to do that? |
Not sure, that's why my initial suspicion was the default bash 3.2. |
Pushed a fix for this which speeds up the interactive bash startup time significantly. Bash loads the completions from /share/ on demand, so they don't have to be preloaded. NixOS also fixed this in the same way in NixOS/nixpkgs#32534 |
As described in detail here: NixOS/nixpkgs#32533 bash will load completion scripts in $p/share/bash-completion/completions/ on startup instead of letting bash-completion do it's lazy loading. Bash startup will then slow down (very noticeable when bash-completion is installed in a profile). This commit leaves loading of scripts in the hands of bash-completion, improving startup time for everyone using `enableCompletion`. Fixes LnL7#101
When I set
programs.bash.enableCompletion = true;
, it adds 0.8s to my login time, regardless of whether the shell is interactive or not. Annoying enough that now I just disable it.The text was updated successfully, but these errors were encountered: