1
0
mirror of https://github.com/nvbn/thefuck.git synced 2024-10-06 10:51:11 +01:00

#398: Add PYTHONIOENCODING=utf-8 to shell aliases

This commit is contained in:
nvbn 2015-11-18 18:37:11 +08:00
parent acd0b3e024
commit 1bb04b41eb

View File

@ -36,7 +36,8 @@ class Generic(object):
return command_script
def app_alias(self, fuck):
return "alias {0}='TF_ALIAS={0} eval $(thefuck $(fc -ln -1))'".format(fuck)
return "alias {0}='TF_ALIAS={0} PYTHONIOENCODING=utf-8 " \
"eval $(thefuck $(fc -ln -1))'".format(fuck)
def _get_history_file_name(self):
return ''
@ -94,7 +95,8 @@ class Generic(object):
class Bash(Generic):
def app_alias(self, fuck):
return "TF_ALIAS={0} alias {0}='eval $(thefuck $(fc -ln -1));" \
return "TF_ALIAS={0} alias {0}='PYTHONIOENCODING=utf-8 " \
"eval $(thefuck $(fc -ln -1));" \
" history -r'".format(fuck)
def _parse_alias(self, alias):
@ -192,7 +194,8 @@ class Fish(Generic):
class Zsh(Generic):
def app_alias(self, fuck):
return "TF_ALIAS={0}" \
" alias {0}='eval $(thefuck $(fc -ln -1 | tail -n 1));" \
" alias {0}='PYTHONIOENCODING=utf-8 " \
"eval $(thefuck $(fc -ln -1 | tail -n 1));" \
" fc -R'".format(fuck)
def _parse_alias(self, alias):