Add devbox-shell bridge line to baked .bash_aliases
If the host bind-mounts ~/.config/devbox-shell/ into the container (the directory-mount pattern that avoids single-file inode breakage), the container needs a bridge line in .bashrc or .bash_aliases to source the mounted file. Previously this bridge had to be re-added manually after every --force-recreate because it lived in the container's writable layer. Baking it into the skel .bash_aliases makes it automatic: every fresh container sources ~/.config/devbox-shell/bash_aliases if it exists, with zero manual steps. Hosts that don't use the devbox-shell pattern are unaffected — the [ -r ... ] test silently skips.
This commit is contained in:
@@ -3,6 +3,15 @@
|
||||
# To override, bind-mount your host's ~/.bash_aliases over this file
|
||||
# via docker-compose.yml.
|
||||
|
||||
# ── Host-shared shell customizations (devbox-shell bridge) ───────────
|
||||
# If the host bind-mounts a directory at ~/.config/devbox-shell/ (the
|
||||
# recommended pattern for sharing aliases/PATH/utilities between host
|
||||
# and container), source the bash_aliases file from it. This survives
|
||||
# --force-recreate because it's baked into the image's skel, not the
|
||||
# container's writable layer. Hosts that don't use this pattern are
|
||||
# unaffected — the test silently skips if the file doesn't exist.
|
||||
[ -r "$HOME/.config/devbox-shell/bash_aliases" ] && . "$HOME/.config/devbox-shell/bash_aliases"
|
||||
|
||||
# ── History persistence and quality ──────────────────────────────────
|
||||
# The named volume devbox-shell-history is mounted at ~/.cache/bash
|
||||
# so history survives container recreation.
|
||||
|
||||
Reference in New Issue
Block a user