twpayne / chezmoi

Manage your dotfiles across multiple diverse machines, securely.
https://www.chezmoi.io/
MIT License
13.37k stars 493 forks source link

Chezmoi's changes don't carry over when restarting the terminal #766

Closed dottagoa closed 4 years ago

dottagoa commented 4 years ago

What exactly am I trying to do?

I am trying to make chezmoi's modifications apply over a restart of the terminal, but I have to run chezmoi apply every time I want to see my changes.

What have I tried so far?

Tried placing chezmoi apply to the start of my zshrc file; did not work as far as I saw.

Where else have I checked for solutions?

Output of any commands you've tried with --verbose

Tried doing so, resulted in no additional output.

Output of chezmoi doctor

$ chezmoi doctor
     ok: version 1.8.1, commit 4def4f3b96cb01cefe8d7887e8dbfb77908ef267, built at 2020-05-06T18:04:46Z, built by goreleaser
     ok: runtime.GOOS linux, runtime.GOARCH amd64
     ok: /home/criti/.local/share/chezmoi (source directory, perm 700)
     ok: /home/criti (destination directory, perm 755)
warning: /home/criti/.config/chezmoi/chezmoi.toml (configuration file)
     ok: /usr/bin/zsh (shell)
     ok: /usr/bin/vi (editor)
     ok: /usr/bin/vimdiff (merge command)
     ok: /usr/bin/git (source VCS command, version 2.20.1)
     ok: /usr/bin/gpg (GnuPG, version 2.2.12)
warning: op (1Password CLI, not found)
warning: bw (Bitwarden CLI, not found)
warning: gopass (gopass CLI, not found)
warning: keepassxc-cli (KeePassXC CLI, not found)
warning: lpass (LastPass CLI, not found)
warning: pass (pass CLI, not found)
warning: vault (Vault CLI, not found)
twpayne commented 4 years ago

I am trying to make chezmoi's modifications apply over a restart of the terminal, but I have to run chezmoi apply every time I want to see my changes.

This is very strange indeed. chezmoi updates the files in your home directory and you only need to run chezmoi apply when your dotfiles change. If you're not seeing the changes that chezmoi made after you restart your terminal then it sounds like either something else is also modifying your home directory or the terminal is opening on to a different computer.

Can you provide more details about your configuration and exact steps to reproduce the problem?

dottagoa commented 4 years ago

Can you provide more details about your configuration and exact steps to reproduce the problem?

I use zsh as my shell with kitty as my terminal.

To reproduce, I open the terminal, and after the shell dotfiles load, I immediately run chezmoi apply. I then close the terminal and start it back up, only to see nothing change.

I’ll update this post with the contents of my zshrc file and my chezmoi directory contents when I get back to my machine.

twpayne commented 4 years ago

Please also post the output of chezmoi apply --verbose.

dottagoa commented 4 years ago

Keep in mind that I used the raw Bash starting text to make reading easier. It would be too hard to have to take three separate screenshots of my oh-my-zsh output.

Here is my current list of files in the chezmoi folder, located in $HOME/.local/share/chezmoi. Listed files with a forward slash obviously mean that it's a subdirectory.

criti@chronos~$ cd .local/share/chezmoi;ls
daymode.sh   dot_conkySanctuary  dot_night.gif  dot_sn_OS_icon.png
dot_config/   dot_conkyViewport   dot_oh-my-zsh/  dot_zshrc
dot_conkyrc  dot_day.png         dot_p10k.zsh   nightmode.sh

This clickable text contains a Pastebin link to view the output of cat ~/.zshrc. If you don't trust text with hyperlinks, then use this: https://pastebin.com/PVxDznWv

And here is the output of chezmoi apply --verbose. The snippet shows no output when using the --verbose option.

criti@chronos~$ chezmoi apply --verbose

criti@chronos~$ 
dottagoa commented 4 years ago

I might as well mention that neofetch starts when I start my terminal; it's been set to do that when viewing the zsh dotfile. When it launches for the first time, though, my ascii art of a trans flag doesn't appear, and instead uses the ascii of my distro, Gallium.

twpayne commented 4 years ago

And here is the output of chezmoi apply --verbose. The snippet shows no output when using the --verbose option.

criti@chronos~$ chezmoi apply --verbose

criti@chronos~$ 

This indicates that all your dotfiles are already up-to-date. chezmoi only makes the minimal changes needed to update your dotfiles to the state you want, so if they're already in the desired state, it does nothing.

dottagoa commented 4 years ago

Okay. Thanks for letting me know!