Skip to content
This repository has been archived by the owner on May 19, 2022. It is now read-only.

Do not "eval" in zsh's _fasd_preexec #99

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

blueyed
Copy link
Contributor

@blueyed blueyed commented Aug 12, 2016

This causes the following to misbehave:

% foo=0
% $((foo++))
zsh: command not found: 1
% echo $foo
2

While it should be:

% foo=0
% $((foo++))
zsh: command not found: 0
% echo $foo
1

This should probably also not be used with the other shells, but I have
not investigated there.

This causes the following to misbehave:

    % foo=0
    % $((foo++))
    zsh: command not found: 1
    % echo $foo
    2

While it should be:

    % foo=0
    % $((foo++))
    zsh: command not found: 0
    % echo $foo
    1

This should probably also not be used with the other shells, but I have
not investigated there.
ZeroKnight added a commit to ZeroKnight/dotfiles that referenced this pull request Oct 25, 2016
  - _fasd_preexec() and fasd_cd are autoloadable functions
  - Backported some PRs from clvv/fasd
    - [clvv/fasd#54] Correction of newline print statement in fasd_cd
    - [clvv/fasd#75] fasd_cd: return 1 in case no dir was found
    - *Partial* [clvv/fasd#77] XDG Compliance
    - [clvv/fasd#99] Do not "eval" in zsh's _fasd_preexec
@ixil
Copy link

ixil commented Dec 14, 2018

Should this also be done to the other evals (e.g. if you use zsh_word_compl...?)
I get a cryptic error if I try to source the $fasd_cache generated by fasd --init zsh-hook posix-alias zsh-ccomp-install zsh-ccomp zsh-wcomp-install zsh-wcomp >| "$fasd_cache"

Error:

(eval):11: parse error near `_fasd_zsh_word_compl...'

@aauren
Copy link

aauren commented Mar 20, 2020

This is a pretty big bug. I recently ran into this and it was a devil to track down. Every time I declared a function, it fasd's pre-exec eval would null out the fasd function and make it equal to ... which would then cause tab completion to completely stop working.

@clvv I know that you haven't been paying a bunch of attention to this project, but is there any way that you would be willing to merge this one PR?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants