@@ -144,15 +144,6 @@ if [ -f "/etc/profile" ]; then
144144 source "/etc/profile"
145145fi
146146
147-
148- if [ -f "$HOME/.bashrc" ]; then
149- source "$HOME/.bashrc"
150- fi
151-
152- if [ -f /etc/bash/bashrc ]; then
153- source /etc/bash/bashrc
154- fi
155-
156147# Environment setup
157148export PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin:/usr/share/bin:/usr/share/sbin:/usr/local/bin:/usr/local/sbin
158149
@@ -161,7 +152,9 @@ export TERM=xterm-256color
161152SHELL=/bin/bash
162153export PIP_BREAK_SYSTEM_PACKAGES=1
163154
164- # Smart path shortening function (fish-style: ~/p/s/components)
155+ # Default prompt with fish-style path shortening (~/p/s/components)
156+ # To use custom prompts (Starship, Oh My Posh, etc.), just init them in ~/.bashrc:
157+ # eval "$(starship init bash)"
165158_shorten_path() {
166159 local path="$PWD"
167160
@@ -190,9 +183,17 @@ _shorten_path() {
190183 [[ "$path" == /* ]] && echo "/$result" || echo "$result"
191184}
192185
193- # Update prompt vars before each command
194186PROMPT_COMMAND='_PS1_PATH=$(_shorten_path); _PS1_EXIT=$?'
195187
188+ # Source user configs AFTER defaults (so user can override PROMPT_COMMAND)
189+ if [ -f "$HOME/.bashrc" ]; then
190+ source "$HOME/.bashrc"
191+ fi
192+
193+ if [ -f /etc/bash/bashrc ]; then
194+ source /etc/bash/bashrc
195+ fi
196+
196197
197198# Display MOTD if available
198199if [ -s /etc/acode_motd ]; then
@@ -236,4 +237,4 @@ chmod +x "$PREFIX/alpine/initrc"
236237
237238else
238239 exec " $@ "
239- fi
240+ fi
0 commit comments