Persist Bash history in WSL devcontainers

Mount a per-devcontainer history directory from the WSL host and point
HISTFILE at it so shell history survives container rebuilds.

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
Fabio Scotto di Santolo
2026-11-11 19:04:19 +01:00
parent e8db4e5f38
commit 25a3b97b14
4 changed files with 22 additions and 2 deletions

View File

@@ -40,6 +40,14 @@
group: "{{ user_group }}"
mode: "0700"
- name: Ensure the persistent Bash history directory mounted into the container exists
ansible.builtin.file:
path: "{{ user_home }}/.local/state/devcontainer-bash-history/cdp"
state: directory
owner: "{{ username }}"
group: "{{ user_group }}"
mode: "0700"
- name: Ensure the private ecaas Git state directory exists
ansible.builtin.file:
path: "{{ ecaas_agent_state }}"

View File

@@ -32,6 +32,14 @@
group: "{{ user_group }}"
mode: "0755"
- name: Ensure the persistent Bash history directory mounted into the container exists
ansible.builtin.file:
path: "{{ user_home }}/.local/state/devcontainer-bash-history/ecaas"
state: directory
owner: "{{ username }}"
group: "{{ user_group }}"
mode: "0700"
- name: Ensure the private ecaas Git state directory exists
ansible.builtin.file:
path: "{{ ecaas_agent_state }}"