nix-community / nix-zsh-completions

ZSH Completions for Nix
BSD 3-Clause "New" or "Revised" License
225 stars 30 forks source link

Failure on nixos-option completion #35

Open toothbrush opened 4 years ago

toothbrush commented 4 years ago

Description

I'm running into an issue where nixos-option isn't able to complete. I think the failure is inside _nix_eval_stdin, but i'm not sure why. It's returning empty from inside _nix_attr_paths. The error shown is:

$ nixos-option
Completing Eval failed, can't complete (an URL might not be cached):

Trace output left in /tmp/zsh28661nixos-option2 (up-history to view)

I have a fair bit of configuration in my .zshrc, from before when i used to run Arch Linux -- so perhaps this is messing with me, but i'm not sure how to debug -- apologies! However, when I completely remove my own Zsh config, things still seem to break.

I've set programs.zsh.enable = true; in my configuration.nix, and many of the completions seem fine, e.g. nixos-option --<TAB> expands to nixos-option --all.

Reproduction steps

Set programs.zsh.enable = true; in configuration.nix, restart session, open terminal and type nixos-option <TAB>.

System

Completion trace

With no ~/.zshrc at all: https://gist.github.com/toothbrush/17426406b47b71934358019eda5ad171 With my usual ~/.zshrc: https://gist.github.com/toothbrush/4f32d5bcd63fb6e238567f1b3a3f5e3c

Freed-Wu commented 7 months ago

I can reproduce this bug:

$ nixos-option <TAB>
Eval failed, can't complete (an URL might not be cached):