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

oh-my-zsh last-working-dir seems to be broken #75

Closed
AndrewVos opened this issue Oct 31, 2013 · 4 comments
Closed

oh-my-zsh last-working-dir seems to be broken #75

AndrewVos opened this issue Oct 31, 2013 · 4 comments

Comments

@AndrewVos
Copy link

My ~/.zshrc

source "$HOME/.antigen/antigen.zsh"

antigen use oh-my-zsh

antigen bundle git
antigen bundle last-working-dir

antigen bundle zsh-users/zsh-syntax-highlighting
antigen bundle zsh-users/zsh-history-substring-search

antigen theme robbyrussell

antigen apply

Output

➜  ~  cd Dropbox 
chpwd:2: no such file or directory: 
@sharat87
Copy link
Member

Yep, I see this too. Removing the local keyword in the 8th line of the plugin script seems to fix the problem.

But, directly sourcing the plugin script (as opposed to calling antigen bundle) doesn't seem to have this problem. I'm not sure what in antigen is causing this, I'll need to look deeper. If anyone has any ideas, please share :)

@sharat87
Copy link
Member

sharat87 commented Mar 7, 2014

I don't see this issue any more. I think that's because I'm using zsh5 now. Do you still face the problem?

Edit: Oops! Spoke too soon. I do see it. On it.

@djmaze
Copy link

djmaze commented May 17, 2014

Having the same problem (with zsh5). Anyone found a real solution yet? There must be more people experiencing this.

@sharat87
Copy link
Member

The reason this happens is because of the local keyword I mentioned in a previous comment. Because the plugin script is source-d within a function, the local variables defined in the script end up being local to that function. This isn't the case when you're using oh-my-zsh directly or when source-ing directly since the local variables there will just be global variables.

The fix is to remove the local keyword from the last-working-directory's cache_file variable definition. As far as I know, that keyword there isn't doing anything anyway.

I'm contemplating adding a fix to the bundle-loading system that modifies the script source to remove these local references before sourcing. Not sure how reliable that'll be.

faceleg added a commit to faceleg/oh-my-zsh that referenced this issue Jan 8, 2015
Error encountered when installed with antigen: "chpwd:2: no such file or directory:".  Solution described in zsh-users/antigen#75
faceleg added a commit to faceleg/oh-my-zsh that referenced this issue Feb 1, 2015
Error encountered when installed with antigen: "chpwd:2: no such file or directory:".  Solution described in zsh-users/antigen#75
LunaCodeGirl pushed a commit to LunaCodeGirl/oh-my-zsh that referenced this issue Feb 23, 2015
Error encountered when installed with antigen: "chpwd:2: no such file or directory:".  Solution described in zsh-users/antigen#75
stoye pushed a commit to stoye/oh-my-zsh that referenced this issue Feb 25, 2015
Error encountered when installed with antigen: "chpwd:2: no such file or directory:".  Solution described in zsh-users/antigen#75
TonyLovesDevOps pushed a commit to TonyLovesDevOps/oh-my-zsh that referenced this issue Apr 24, 2015
Error encountered when installed with antigen: "chpwd:2: no such file or directory:".  Solution described in zsh-users/antigen#75
lewg pushed a commit to lewg/oh-my-zsh that referenced this issue May 13, 2015
Error encountered when installed with antigen: "chpwd:2: no such file or directory:".  Solution described in zsh-users/antigen#75
fooblahblah pushed a commit to fooblahblah/oh-my-zsh that referenced this issue May 15, 2015
Error encountered when installed with antigen: "chpwd:2: no such file or directory:".  Solution described in zsh-users/antigen#75
cabbiepete pushed a commit to cabbiepete/oh-my-zsh that referenced this issue Jun 29, 2015
Error encountered when installed with antigen: "chpwd:2: no such file or directory:".  Solution described in zsh-users/antigen#75
e2 pushed a commit to e2/oh-my-zsh that referenced this issue Jul 8, 2015
Error encountered when installed with antigen: "chpwd:2: no such file or directory:".  Solution described in zsh-users/antigen#75
kirb pushed a commit to kirb/oh-my-zsh that referenced this issue Aug 23, 2015
Error encountered when installed with antigen: "chpwd:2: no such file or directory:".  Solution described in zsh-users/antigen#75
NobbZ pushed a commit to NobbZ/oh-my-zsh that referenced this issue May 15, 2016
Error encountered when installed with antigen: "chpwd:2: no such file or directory:".  Solution described in zsh-users/antigen#75
fforw pushed a commit to fforw/oh-my-zsh that referenced this issue Feb 21, 2017
Error encountered when installed with antigen: "chpwd:2: no such file or directory:".  Solution described in zsh-users/antigen#75
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

3 participants