Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Antigen is trying to find .zshrc in home folder after moving It to new directory #722

Open
thales-maciel opened this issue Nov 16, 2020 · 1 comment

Comments

@thales-maciel
Copy link

Description

Antigen is trying to find .zshrc in home folder after moving It to new directory and declaring new ZDOTDIR in .zshenv (located in home).

From time to time (usually when I open my second shell after logging in), I lose my prompt and all my plugins, but everything else located in my .zshrc still works (sourcing aliases, scripts, LS_COLORS and so on).

When trying to source my .zshrc manually in this terminal I got the default antigen messages saying that my plugins are installed, but I'm still not able to use them untill I do antigen reset and open a new shell.

This new shell now says: -antigen-cache-generate:zcompile:65: can't open file: /home/<my-username>/.zshrc, but this time all my plugins are correctly sourced and ready to use.

This behavior is still happening after complete re-install and deleting the .zwc and .zcompdump files.

Steps to reproduce

1 - Change ZDOTDIR in ~/.zshenv
2 - Move files there
3 - Open new terminal (maybe restart)

Expected behavior:

All plugins should be available without needing to reset antigen.

Software version

  • antigen version v2.2.2
  • zsh --version zsh 5.8
  • uname -a Linux pop-os 5.8.0-7625-generic #26~1603389471~20.04~f6b125f-Ubuntu SMP Thu Oct 22 20:35:49 UTC x86_64 x86_64 x86_64 GNU/Linux

Configuration

  • gist of ~./zshenv:
typeset -U PATH path

export LANGUAGE=en_US.UTF-8

# ~/ Clean-up:
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_CACHE_HOME="$HOME/.cache"

# Default Apps
export TERMINAL="alacritty"
export EDITOR="nvim"
export VISUAL="nvim"

# Other program settings:
export FZF_DEFAULT_OPTS="--layout=reverse --height 40%"


export ZDOTDIR="${XDG_CONFIG_HOME}/zsh"

export ADOTDIR="${ZDOTDIR}/antigen"


path=(~/.local/bin ~/scripts $path)
  • gist of .antigenrc:
# Load oh-my-zsh library.
antigen use oh-my-zsh

# Default repo (oh-my-zsh).
antigen bundle git
antigen bundle lein
antigen bundle extract
antigen bundle command-not-found
antigen bundle zsh-interactive-cd

# External repos.
antigen bundle zsh-users/zsh-completions
antigen bundle zsh-users/zsh-autosuggestions
antigen bundle zsh-users/zsh-syntax-highlighting
antigen bundle wfxr/forgit

# Prompt theme.
antigen bundle denysdovhan/spaceship-prompt

# Apply
antigen apply
  • gist of .zshrc:
LS_COLORS=$LS_COLORS:'ow=01;34:' ; export LS_COLORS
 
SPACESHIP_PROMPT_ORDER=(
  time
  #user          # Username section
  venv
  dir           # Current directory section
  host          # Hostname section
  git           # Git section (git_branch + git_status)
  hg            # Mercurial section (hg_branch  + hg_status)
  node
  ruby
  golang
  rust
  docker
  conda
  pyenv
  exec_time     # Execution time
  line_sep      # Line break
  vi_mode       # Vi-mode indicator
  jobs          # Background jobs indicator
  exit_code     # Exit code section
  char          # Prompt character
)
 
SPACESHIP_USER_SHOW="always" # Shows System user name before directory name
 
SPACESHIP_PROMPT_ADD_NEWLINE=true
SPACESHIP_PROMPT_FIRST_PREFIX_SHOW=true

 
SPACESHIP_CHAR_SYMBOL=""
SPACESHIP_CHAR_SUFFIX=" "

SPACESHIP_DIR_PREFIX=''
# SPACESHIP_DIR_TRUNC=1 # Shows only the last directory folder name

SPACESHIP_VENV_PREFIX="("
SPACESHIP_VENV_SUFFIX=") "
SPACESHIP_VENV_GENERIC_NAMES=false

[[ -s $HOME/.nvm/nvm.sh ]] && . $HOME/.nvm/nvm.sh  # This loads NVM

# Load Antigen
source ${ZDOTDIR:-~}/antigen.zsh # this depends on where you saved the file

# Load Antigen Configurations
antigen init ${ZDOTDIR:-~}/.antigenrc

#fzf
source /usr/share/doc/fzf/examples/key-bindings.zsh
source /usr/share/doc/fzf/examples/completion.zsh

fpath+=${ZDOTDIR:-~}/.zsh_functions

# Aliases
if [[ -r ${ZDOTDIR:-~}/.aliases ]]; then
  . ${ZDOTDIR:-~}/.aliases
fi

# Hide % on start
unsetopt PROMPT_SP

More information

  • After running antigen reset, I'm able to work without issues until the next time I boot, even when opening multiple shells.
  • It didn't happened inside pycharm for some reason
  • I open a terminal instance by default in every log in, this terminal is always ok and running without problems.
@thales-maciel
Copy link
Author

Update

Added the line: typeset -a ANTIGEN_CHECK_FILES=(${ZDOTDIR:-~}/.zshrc ${ZDOTDIR:-~}/antigen.zsh) before sourcing antigen.zsh in my .zshrc.

Now the behavior is the same, but I no longer see this message: -antigen-cache-generate:zcompile:65: can't open file: /home/<my-username>/.zshrc, so that's a start...

I can reproduce this very easily now, I just have to open a terminal inside pycharm and then open another one in my terminal.

Every time I open a new terminal inside pycharm, I see all the installing messages, I tested in vscode and It doesn't happens there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant