chisui / zsh-nix-shell

zsh plugin that lets you use zsh in nix-shell shells.
BSD 3-Clause "New" or "Revised" License
384 stars 19 forks source link

Fix NIX_SHELL_PACKAGES with multiple -p arguments #7

Closed alyssais closed 6 years ago

alyssais commented 6 years ago

nix-shell allows the -p option to be repeated before each package:

nix-shell -p ruby -p bundler

Currently, the -p handler just appends the argument after the -p onto the end of NIX_SHELL_PACKAGES, meaning there's no separation between them, e.g. "rubybundler". The fix is to additionally add a space if NIX_SHELL_PACKAGES is already non-empty.

chisui commented 6 years ago

Thank you. It's even documented in the man-page.

I don't know if this will mess up NIX_SHELL_PACKAGES contents if you pass more complex expressions via -p. But this PR definitely helps.