-
-
Notifications
You must be signed in to change notification settings - Fork 56
Open
Description
Hello, I was wondering if there is a proto deactivate equivalent for users that choose to go down the proto activate route. This is how I remember doing similar things in python environments so I'm not sure if I'm possibly missing something here. Looking for some quick options in bash I could likely undo the activation for bash via something like.
# Restore original PATH if it was saved
if [ -n "$__ORIG_PATH" ]; then
export PATH="$__ORIG_PATH"
unset __ORIG_PATH
fi
# Remove _proto_activate_hook from PROMPT_COMMAND
if [[ "$(declare -p PROMPT_COMMAND 2>&1)" == "declare -a"* ]]; then
# PROMPT_COMMAND is an array
PROMPT_COMMAND=("${PROMPT_COMMAND[@]//_proto_activate_hook/}")
else
# PROMPT_COMMAND is a string
PROMPT_COMMAND="${PROMPT_COMMAND//_proto_activate_hook;}"
PROMPT_COMMAND="${PROMPT_COMMAND//_proto_activate_hook/}"
fi
# Unset the proto hook function
unset -f _proto_activate_hook 2>/dev/nullI just worry about something like this breaking with later versions of proto if it is not internaly supported
Metadata
Metadata
Assignees
Labels
No labels