thefuck: Cannot run fuck in zsh without export errors
Installed via pip. Ran eval β$(thefuck --alias)β in both bash and zsh. $ fuck then produces βNo fucks givenβ in bash while in zsh it complains about invalid arguments.
$ eval "$(thefuck --alias)"
$ fuck
fuck:export:3: not valid in this context: -'
fuck:3: not an identifier: [skip
Also FWIW:
$ zsh --version
zsh 4.3.11 (x86_64-redhat-linux-gnu)
$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.8 (Santiago)
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 15
Commits related to this issue
- Avoid masking shell return values in Zsh.app_alias I discovered that a common shell script issue (https://github.com/koalaman/shellcheck/wiki/SC2155) is present in the script returned by `Zsh.app_ali... — committed to chrismendis/thefuck by chrismendis 6 years ago
- Avoid masking shell return values in Zsh.app_alias (#820) I discovered that a common shell script issue (https://github.com/koalaman/shellcheck/wiki/SC2155) is present in the script returned by `Zsh.... — committed to nvbn/thefuck by chrismendis 6 years ago
- Avoid masking shell return values in Zsh.app_alias (#820) I discovered that a common shell script issue (https://github.com/koalaman/shellcheck/wiki/SC2155) is present in the script returned by `Zsh.... — committed to riley-martine/thefuck by chrismendis 6 years ago
it seems that was a issue of zsh.
when run
export TF_SHELL_ALIASES=$(alias)
in zsh, you can see the same error.run
unalias -- -
and this error will disappear, but another error comes.my way to deal with this problem is not use
eval "$(thefuck --alias)"
in ~/.zshrcrun
thefuck --alias
in your shell, delete the line which containexport TF_SHELL_ALIASES=$(alias)
, and write the output in your .zshrcjust like
It may not the best way to deal with this problem, but it really works.
So this is not an issue anymore since some 5.2 minor (?) version:
Zsh 5.2 was released almost 3 years ago.
The question now is: should we support old versions?
Please cast your vote with either π or π reaction to this very message:
Thanks!
@scorphus Thefuck works fine on Ubuntu with zsh, but I met the above problem on mac.