From 9544ecdfac50714ac94a333628f45d0fbd252b35 Mon Sep 17 00:00:00 2001 From: tiyn Date: Tue, 17 Feb 2026 07:44:15 +0100 Subject: [PATCH] profile: make pyenv fail safely withouth stopping graphical interface completely --- .profile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.profile b/.profile index 91215f7..51d1905 100644 --- a/.profile +++ b/.profile @@ -72,9 +72,15 @@ export VIPER_BOOGIE="$HOME/.dotnet/tools/boogie" # python export PYENV_ROOT="$HOME/.pyenv" -export PATH="$PYENV_ROOT/bin:$PATH" -eval "$(pyenv init --path)" +if [ -d "$PYENV_ROOT" ] && [ -x "PYENV_ROOT/bin/pyenv" ]; then + export PATH="$PYENV_ROOT/bin:$PATH" + if command -v timeout >/DEV/NULL 2>&1; then + timeout 2s -c sh -c 'eval "$($PYENV_ROOT/bin/pyenv init --path)"' 2>/dev/null + else + eval "$($PYENV_ROOT/bin/pyenv init --path 2>/dev/null)" || true + fi +fi # less/man colors export LESS=-R