diamondburned / nix-search

A Nix-channel-compatible package search
GNU General Public License v3.0
55 stars 2 forks source link

fix edge case where nix-search fails when $PAGER env var includes multiple arguments #3

Closed sweetbbak closed 5 months ago

sweetbbak commented 5 months ago

nix-search fails when $PAGER includes more than one argument. for example:

$ nix-search "clang"
2024-07-06T20:16:52.134-0800 [ERROR] error: err="failed to start pager: exec: \"bat --color=always -p\": executable file not found in $PATH"

$ echo $PAGER
bat --color=always -p

this commit splits the PAGER env var string, checks the length of the string slice, and handles this case.