1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-03-19 00:58:56 +00:00

Fix zsh alias

This commit is contained in:
Jarrod Moore 2017-11-16 15:39:43 +11:00
parent 10ac1a3b38
commit 0843f061cc

View File

@ -13,14 +13,16 @@ 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_HISTORY=$(fc -ln -10) TF_PYTHONIOENCODING=$PYTHONIOENCODING;
export TF_ALIAS={name};
export TF_SHELL_ALIASES=$(alias);
export TF_HISTORY="$(fc -ln -10)";
export PYTHONIOENCODING=utf-8;
TF_CMD=$( TF_CMD=$(
TF_ALIAS={name} thefuck {argument_placeholder} $@
TF_SHELL_ALIASES=$(alias)
TF_HISTORY=$TF_HISTORY
PYTHONIOENCODING=utf-8
thefuck {argument_placeholder} $*
) && eval $TF_CMD; ) && eval $TF_CMD;
unset TF_HISTORY;
export PYTHONIOENCODING=$TF_PYTHONIOENCODING;
{alter_history} {alter_history}
}} }}
'''.format( '''.format(