Persist bash history and bake shell quality-of-life defaults
Two changes that address a longstanding frustration: bash history is lost on every container recreate, and the container's ~/.bashrc and ~/.inputrc are stock Debian (no history tuning, no prefix search on arrow keys, no integrations). Added a named volume 'devbox-shell-history' mounted at ~/.cache/bash with HISTFILE pointing there; history now survives 'docker compose up --force-recreate'. The volume is added to both docker-compose.yml and docker-compose.shared.yml, and ~/.cache/bash is registered in the entrypoint ownership-fix loop per the AGENTS.md convention. Baked rootfs/home/developer/.bash_aliases (sourced automatically by Debian's default ~/.bashrc) and rootfs/home/developer/.inputrc into the image. They give new containers: 100k-entry timestamped dedup history with per-prompt flush, Up/Down arrow prefix history search, case-insensitive coloured completion, aliases that prefer eza and bat when present, git shortcuts, interactive rm/mv/cp, zoxide and fzf (via 'fzf --bash') integration, and a [devbox] prompt marker. The fzf integration uses 'fzf --bash' because we install fzf from GitHub releases, not apt — the apt-path key-bindings aren't present. Users who prefer their host's own shell config can uncomment two commented bind-mount lines in docker-compose.yml to shadow the baked defaults.
This commit is contained in:
@@ -52,6 +52,16 @@ services:
|
||||
# Optional: persist opencode TUI settings (theme, toggles, etc.)
|
||||
- devbox-state:/home/developer/.local/state/opencode
|
||||
|
||||
# Persist bash history across container recreations.
|
||||
# Without this, ~/.bash_history is lost on 'docker compose up --force-recreate'.
|
||||
- devbox-shell-history:/home/developer/.cache/bash
|
||||
|
||||
# Optional: override baked shell defaults with your host's rc files.
|
||||
# The image ships sensible defaults (history tuning, prefix-search on
|
||||
# Up/Down arrows, fzf/zoxide integration). Uncomment to use your own:
|
||||
# - ~/.bash_aliases:/home/developer/.bash_aliases:ro
|
||||
# - ~/.inputrc:/home/developer/.inputrc:ro
|
||||
|
||||
# Optional: persist uv data (Python installs, tool installs)
|
||||
# Without this, 'uv python install' must be re-run after container removal.
|
||||
- devbox-uv:/home/developer/.local/share/uv
|
||||
@@ -70,6 +80,7 @@ services:
|
||||
volumes:
|
||||
devbox-data:
|
||||
devbox-state:
|
||||
devbox-shell-history:
|
||||
devbox-uv:
|
||||
# devbox-rustup:
|
||||
# devbox-cargo:
|
||||
|
||||
Reference in New Issue
Block a user