@@ -5,6 +5,27 @@ if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]
55 source " ${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
66fi
77
8+ # Docker shares safe state from host home (cli history, zoxide, ssh)
9+ if [[ -n " $IN_DOCKER" ]] && [[ -d " /host-home" ]]; then
10+ if [[ -f " /host-home/.zsh_history" ]] && [[ ! -L " $HOME/.zsh_history" ]]; then
11+ [[ -f " $HOME/.zsh_history" ]] && rm " $HOME/.zsh_history"
12+ ln -sf /host-home/.zsh_history " $HOME/.zsh_history"
13+ fi
14+
15+ if [[ -f " /host-home/.local/share/db.zo" ]]; then
16+ mkdir -p " $HOME/.local/share"
17+ if [[ ! -L " $HOME/.local/share/db.zo" ]]; then
18+ [[ -f " $HOME/.local/share/db.zo" ]] && rm " $HOME/.local/share/db.zo"
19+ ln -sf /host-home/.local /share/db.zo " $HOME/.local/share/db.zo"
20+ fi
21+ fi
22+
23+ if [[ -d " /host-home/.ssh" ]] && [[ ! -L " $HOME/.ssh" ]]; then
24+ [[ -d " $HOME/.ssh" ]] && rm -rf " $HOME/.ssh"
25+ ln -sf /host-home/.ssh " $HOME/.ssh"
26+ fi
27+ fi
28+
829### Added by Zinit's installer
930if [[ ! -f $HOME /.local /share/zinit/zinit.git /zinit.zsh ]]; then
1031 print -P " %F {33} %F {220}Installing %F {33}ZDHARMA-CONTINUUM%F {220} Initiative Plugin Manager (%F {33}zdharma-continuum/zinit%F {220})…%f "
99120{{- end }}
100121
101122# towards the beginning to make sure some software is loaded
102- zinit lucid light-mode for " hpc"
123+ zinit lucid atload'unalias zi' light-mode for " hpc"
103124
104125zinit ice lucid depth" 1"
105126zinit light romkatv/powerlevel10k
@@ -222,7 +243,12 @@ function backup_zoxide_database () {
222243
223244backup_zoxide_database
224245
225- [ -f "${HOME}/.shell-secrets" ] && source "${HOME}/.shell-secrets"
246+ # Source shell secrets (prefer host secrets when in Docker)
247+ if [[ -n "$IN_DOCKER" ]] && [[ -f "/host-home/.shell-secrets" ]]; then
248+ source "/host-home/.shell-secrets"
249+ elif [[ -f "${HOME}/.shell-secrets" ]]; then
250+ source "${HOME}/.shell-secrets"
251+ fi
226252
227253# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
228254[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
0 commit comments