mirror of
https://github.com/nvbn/thefuck.git
synced 2025-01-31 10:11:14 +00:00
#620: Fix aliases with zsh
This commit is contained in:
parent
ec37998a10
commit
7532c65c62
@ -11,11 +11,13 @@ class Zsh(Generic):
|
|||||||
# It is VERY important to have the variables declared WITHIN the function
|
# It is VERY important to have the variables declared WITHIN the function
|
||||||
return '''
|
return '''
|
||||||
{name} () {{
|
{name} () {{
|
||||||
TF_ALIAS={name};
|
|
||||||
PYTHONIOENCODING=utf-8;
|
|
||||||
TF_SHELL_ALIASES=$(alias);
|
|
||||||
TF_PREVIOUS=$(fc -ln -1 | tail -n 1);
|
TF_PREVIOUS=$(fc -ln -1 | tail -n 1);
|
||||||
TF_CMD=$(thefuck $TF_PREVIOUS {argument_placeholder} $*) && eval $TF_CMD;
|
TF_CMD=$(
|
||||||
|
TF_ALIAS={name}
|
||||||
|
TF_SHELL_ALIASES=$(alias)
|
||||||
|
PYTHONIOENCODING=utf-8
|
||||||
|
thefuck $TF_PREVIOUS {argument_placeholder} $*
|
||||||
|
) && eval $TF_CMD;
|
||||||
{alter_history}
|
{alter_history}
|
||||||
}}
|
}}
|
||||||
'''.format(
|
'''.format(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user