Fix TrueNAS SCALE oriented cli tools

This commit is contained in:
Lockszmith (@kateryna) 2024-11-24 21:54:37 -05:00
parent db7ba3de56
commit ec1123ecb9
3 changed files with 18 additions and 5 deletions

View file

@ -15,9 +15,9 @@ BASE_SHELL=$(basename "$SHELL")
if is_sourced; then
zellij-cleanup() {
[[ -r "$HOME/bin/zellij" ]] && rm "$HOME/bin/zellij"
[[ -d "$HOME/.cache/zellij" ]] && rm -fR "$HOME/.cache/zellij"
[[ -d /tmp/zellij ]] && rm -fR /tmp/zellij
type -pa zellij > /dev/null && type -pa zellij | sed -Ee 's/^.* is //' | awk '{ print $1 }' | grep -E "^$HOME" | xargs -tr rm
[[ -d "$HOME/.cache/zellij" ]] && echo "$HOME/.cache/zellij" | xargs -rt rm -fR
find /tmp -maxdepth 1 -mindepth 1 -type d -name 'zellij*' -print0 | xargs -r0t rm -fR
printf 'Zellij has been cleaned up, you can now reinstall it.\n'
}
zellij() {
@ -38,11 +38,14 @@ if is_sourced; then
fi
}
zellij-completion() {
if [[ "${BASE_SHELL}" == "zsh" ]]; then
. <( zellij setup --generate-completion zsh | sed -Ee 's/^(_(zellij) ).*/compdef \1\2/' )
else
. <( zellij setup --generate-completion "$BASE_SHELL" )
fi
}
zellij-completion
# Was needed when zsh would load
# . <( zellij setup --generate-completion "$BASE_SHELL" | sed -ne '/^function/,$p' )
if [[ -z "$ZELLIJ_SESSION_NAME" ]]; then