This commit is contained in:
2026-03-10 23:09:05 +08:00
parent 1c08c96d32
commit 7a38199dde
16 changed files with 1702 additions and 1 deletions
+16
View File
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
# Ensure /opt/venv/bin is first even if ~/.local/bin or ~/.cargo/bin prepend themselves via user dotfiles.
_venv_path_fix() {
# remove any existing /opt/venv/bin entries, then prepend one
local newpath
newpath="$(printf '%s' "$PATH" | awk -v RS=: -v ORS=: '$0!="/opt/venv/bin"{print}')"
PATH="/opt/venv/bin:${newpath%:}"
}
# run once after shell init; don't duplicate
case "$PROMPT_COMMAND" in
*_venv_path_fix*) : ;;
*) PROMPT_COMMAND="_venv_path_fix${PROMPT_COMMAND:+;$PROMPT_COMMAND}" ;;
esac