1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-01-18 12:06:04 +00:00

#921: Try printing alias before trying to fix a command (#923)

Fixes #921
This commit is contained in:
Pablo Aguiar 2019-06-26 15:01:38 -03:00 committed by Vladimir Iakovlev
parent 48e1e4217f
commit e047c1eb40

View File

@ -22,10 +22,13 @@ def main():
elif known_args.version:
logs.version(get_installation_info().version,
sys.version.split()[0], shell.info())
elif known_args.command or 'TF_HISTORY' in os.environ:
fix_command(known_args)
# It's important to check if an alias is being requested before checking if
# `TF_HISTORY` is in `os.environ`, otherwise it might mess with subshells.
# Check https://github.com/nvbn/thefuck/issues/921 for reference
elif known_args.alias:
print_alias(known_args)
elif known_args.command or 'TF_HISTORY' in os.environ:
fix_command(known_args)
elif known_args.shell_logger:
try:
from .shell_logger import shell_logger # noqa: E402