Skip to content

Commit 272da8b

Browse files
committed
shell: add zsh autocomplete load for default zsh shells
1 parent 6f142ba commit 272da8b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

flakeModules/shell.nix

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,11 @@ in
157157
defaultZshCompFpathLoading = mkOption {
158158
description = mdDoc "The cardano-parts default zsh completion fpath loading hook.";
159159
default = globalDefault isGlobal (packages: ''
160+
# Direnv use prevents the dynamic loading of zsh completions,
161+
# requiring a zsh "reentry" upon arriving in the devShell.
162+
# (ie: `zsh` or `exec zsh -l`, etc.
163+
#
164+
# If using plain nix develop, zsh "reentry" is not required.
160165
export ZDOTDIR=$PWD/.direnv-zsh
161166
mkdir -p "$ZDOTDIR"
162167
rm -f "$ZDOTDIR/.zcompdump"*
@@ -185,6 +190,8 @@ in
185190
echo "To return to your normal zsh without devShell fpath modifications, run \"zsh-base\" before leaving the repo directory,"
186191
echo "otherwise, close and open a new zsh shell to avoid lingering devShell command completions."
187192
echo
193+
echo "To re-enter the completions in this devShell with direnv, run \"exec zsh -l\" or similar."
194+
echo
188195
EOF
189196
'');
190197
};

0 commit comments

Comments
 (0)