~postmarketos/pmbootstrap

59898f515ac5e70e194b7b3ba392f90df4d26c64 — xtex 8 months ago fc3d8b0
helpers/envkernel.fish: add deactivate & reactivate function for fish

Signed-off-by: xtex <xtexchooser@duck.com>
Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20240113123358.6142-3-xtex@envs.net%3E
1 files changed, 14 insertions(+), 0 deletions(-)

M helpers/envkernel.fish
M helpers/envkernel.fish => helpers/envkernel.fish +14 -0
@@ 40,3 40,17 @@ if test -z "$ENVKERNEL_DISABLE_PROMPT"
        _old_fish_prompt
    end
end

# Deactivate
function deactivate
	if functions -q _old_fish_prompt
		functions -e fish_prompt
		functions -c _old_fish_prompt fish_prompt
		functions -e _old_fish_prompt
	end
	functions -e make kernelroot pmbootstrap pmbroot
	functions -e deactivate reactivate
end

# Reactivate
alias reactivate "deactivate; pushd '$PWD'; . '$pmbootstrap_dir'/helpers/envkernel.fish; popd"