-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
poor first-use experience due to missing "complete", etc. #8764
Comments
What happens if you run I suspect you're in a bit of a hall of mirrors. It might also be interesting to see what |
Hi @abathur -- you've given me some ideas, both for fixing my own situation and for language that could go into the first-steps tutorial, something like:
I'm still cleaning up a few decade's worth of weeds in my own dotfiles -- some of the stuff in there dates back to pre-bash Korn shell days. For the record, answering your questions:
This led me to try this, which provided a major clue:
I have some 'complete' commands in scripts that are sourced from .bashrc. Something in nix's invocation of 'cowsay' is apparently running a noninteractive bash, and because BASH_ENV is set to .bashrc, those 'complete' commands are being attempted. Still looking. |
That might explain it. Yes, generally scripts/wrappers use the non-interactive bash (such wrappers are common in the ecosystem and cowsay is wrapped: https://github.com/NixOS/nixpkgs/blob/9d10b637e46e87fd3dcb40402ea6418e60ac433c/pkgs/tools/misc/cowsay/default.nix#L29). |
All right y'all. This noninteractive bash default thing really ought to be fixed; if a fix in code isn't viable, then I'll be happy to take this over to the nix.dev repo and fix it in the "first steps" page -- let me know. As things stand right now, I've just now thrashed around for too long myself without finding a clear answer. Any reasonably experienced UNIX or Linux user is going to have bash completion scripts sourced from their .bashrc, they are going to run smack into this error on first use, and they are going to want to learn the idiomatic way to correct it.
I could keep thrashing around and come up with a solution that works for me on my own machine, but after years of being referred to in print as being a fellow traveler in the concepts behind nix and NixOS, I kinda want to make sure other new users have a better experience than this. I'm glad I finally found an excuse to start playing with nix -- I'm impressed by the quality of the nixos.org and nix.dev sites otherwise, but this completion error thing seems like a glaring omission.
Background
Install appeared okay other than seeing a pile of 'complete' errors when running
nix-shell -p nix-info --run "nix-info -m"
at the end. Then while following https://nix.dev/tutorials/first-steps/ad-hoc-shell-environments I ran into this:I'm ignoring the perl error for now -- I'll deal with that myself.
Observations
The word "complete" does not appear on https://nix.dev/tutorials/first-steps/ad-hoc-shell-environments at all, which is where most folks will start trying to troubleshoot the problem.
After digging around in #730, #4254, #6091, #6982, and even reddit, I still don't have a clear idea of what a user is supposed to do to avoid getting these errors when running the tutorial. I see comments like "just use bashInteractive" mentioned several times, but a new nix user won't know what that means.
I've spent an hour or so on this myself so far, including taking the time to write this bug.
Question
Can anyone provide a clear, concise, idiomatic way to get rid of the 'complete' errors? If not a code change, then at least text suitable for inserting into the "first steps" tutorial?
The only thing I've thought of so far, given my own lack of experience with nix, is to wrap my .bashrc completion includes in an
if
statement that checks to see if IN_NIX_SHELL is set. Is that what we want to expect new users to do, or is there a better way?The text was updated successfully, but these errors were encountered: